Silverlight 存储当前用户信息问题!
无常名 2012-05-22 05:39:27 Silverlight存储当前登录用户信息有哪几种方式?
1、使用独立存储的方式,在用户退出的时候要主动删除,如果直接关闭浏览器会自动删除吗?
2、在网上查的这种方法可行吗?
在web.config中<system.serviceModel >下添加:
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
然后:在服务类[不是接口]下添加如下属性:
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
接下来就可以使用Session记得添加System.Web的引用
HttpContext.Current.Session["YourName"] = something;
object something = HttpContext.Current.Session["YourName"];