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

    //其他的操作

    }

  • 相关阅读:
    SQL字符串操作汇总
    重构之道清除代码异味
    Html.Action和Html.RederAction来创建子视图
    C#实现Thrift连接池[新]
    CentOS下配置Apache反向代理出错的解决
    entity framework实体用数据库默认值的方法
    为IEnumerable类型添加Add方法
    一个对Entity Framework数据层的封装
    将.netFramework4.5/MVC4/EF5/Oracle网站发布到Server2008/iis7的痛苦经历
    让vs2012运行vs2010插件的方法
  • 原文地址:https://www.cnblogs.com/xuxin-1989/p/3655725.html
Copyright © 2020-2023  润新知