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();

//其他的操作

}

silverlight+wcf 获得web参数,古老的榕树,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。