zoukankan      html  css  js  c++  java
  • silverlight+wcf 获得web参数

    可以由wcf直接得到参数 ,具体代码如下:

    using System;
    using System.Linq;
    using System.Runtime.Serialization;
    using System.ServiceModel;
    using System.ServiceModel.Activation;
    using System.Collections.Generic;
    using BS.EAP.DBAccess;
    using System.Data;
    using System.Xml;
    using System.Collections;
    using BS.EAP.Authentication;//引用到的类型CurrentUserInfo
    using BS.EAP.Account.Model; //引用到的类型SYS_APPLICATIONInfo

     public class DBService : System.Web.UI.Page //继承类 Session
        {

     [OperationContract]
            public void DoWork()
            {
                // 在此处添加操作实现
                return;
            }

    //定义全局变量接收参数
            public static string strUserid;
            public static string strAppid;
            public static string strChartName;

    //

            /// <summary>
            /// 当前用户信息 CurrentUserInfo 是类: CurrentUserInfo.cs
            /// </summary>
            public CurrentUserInfo CurrentUserInfo
            {
                get
                {
                    if (Session["CurrentUserInfo"] != null)
                    {
                        return (CurrentUserInfo)Session["CurrentUserInfo"];
                    }
                    return null;
                }
            }

            /// <summary>
            /// 当前业务类别 SYS_APPLICATIONInfo 是类:SYS_APPLICATIONInfo.cs
            /// </summary>
            public SYS_APPLICATIONInfo CurrentApplication
            {
                get
                {
                    if (Session["CurrentApplication"] != null)
                    {
                        return (SYS_APPLICATIONInfo)Session["CurrentApplication"];
                    }
                    return null;
                }
                set
                {
                    Session["CurrentApplication"] = value;
                }
            }

     strUserid= CurrentUserInfo.CurrUserInfo.USERID.ToString();
     strAppid= this.CurrentApplication.APPID.ToString();

    //其他的操作

    }

  • 相关阅读:
    最大似然估计
    信号和槽:Qt中最差劲的创造
    从生物神经网络到人工神经网络
    巩固一下C语言中的指针
    linux启动后自动登录并运行自定义图形界面程序
    删除linux系统服务
    《痞子衡嵌入式半月刊》 索引
    痞子衡嵌入式:恩智浦i.MX RTxxx系列MCU开发那些事
    痞子衡嵌入式:高性能MCU之音视频应用开发那些事
    痞子衡嵌入式:恩智浦i.MX RT1xxx系列MCU开发那些事
  • 原文地址:https://www.cnblogs.com/xuxin-1989/p/3655725.html
Copyright © 2011-2022 走看看