System.Web.Security.FormsAuthentication.RedirectFromLoginPage("username", ture);
此为表单身份验证,上为创建一个持久性cookie名为username.
用法:
    配置web.config
        system.web>
<authentication mode="Forms">
      
      <forms loginUrl="login.aspx" name="cookiename" timeout="60" path="/"            protection="All"></forms>
    </authentication>
    <authorization>
      <deny users="?"/>
    </authorization> 详细解释:你可以找点资料.

解决方案 »

  1.   


    System.Web.Security.FormsAuthentication.RedirectFromLoginPage("username", ture);
    此为表单身份验证,上为创建一个持久性cookie.
    用法:
        配置web.config
            system.web>
    <authentication mode="Forms">
          
          <forms loginUrl="login.aspx" name="cookiename" timeout="60" path="/"            protection="All"></forms>
        </authentication>
        <authorization>
          <deny users="?"/>
        </authorization> 详细解释:你可以找点资料.