config配置
<!--未登陆跳转至登陆页面 -->
</system.web>
<authorization>
<allow roles="admin"/>
<deny users="*"/>
</authorization>
</system.web>
登陆成功后写入身份
HttpCookie cook;
string roles = "admin"; //用户角色
//下面代码的意思是传入用户名name,将此用户角色变为admin使其有权限,用户登录后才可以访问2级目录
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(
1, context.Request.Form["uid"], DateTime.Now, DateTime.Now.AddMinutes(120), false, roles);
cook = new HttpCookie("mycook");
cook.Value = FormsAuthentication.Encrypt(ticket); System.Web.HttpContext.Current.Response.Cookies.Add(cook);
目的street0目录下的页面是用户登陆后才可以访问
本地运行目的达到,IIS6.0发布无效果
求IIS6.0该怎么配置或是我代码错在哪里