Discuz!NT官方社区

首页 » Discuz!NT开发与测试 » Discuz!NT整合 » 难题,我的用户整合难题
lhf3277 - 2007-12-27 18:05:00
string Domainym = System.Configuration.ConfigurationManager.AppSettings["yuming"]; //通用域
                string user_name = model.username.ToString(); //用户名
                string userRoles = model.Ltype.ToString(); //用户类型
                FormsAuthenticationTicket Ticket = new FormsAuthenticationTicket(1, user_name, DateTime.Now, DateTime.Now.AddMinutes(30), false, userRoles,"/");
                string HashTicket = FormsAuthentication.Encrypt(Ticket);
                HttpCookie UserCookie = new HttpCookie(FormsAuthentication.FormsCookieName, HashTicket);
                UserCookie.Domain = Domainym;
                HttpContext.Current.Response.Cookies.Add(UserCookie);
这是我原来的站上写的登录代码
其它userRoles是用来划分用户类型的,不同的用户有不同的限权进后自己的后台目录.目录己
<authorization>
        <allow roles="1,100" />
        <deny users="*" />
      </authorization>
进行了限制.

那么我想问一下,现在DZ的登录代码中可不可以做到我以上实现的东能...要ZD的登录代码写入的COOKIE带有roles功能
1
查看完整版本: 难题,我的用户整合难题