Web. config
<Authentication mode = "forms">
<Forms loginurl = "login. aspx"
Protection = "all"
Timeout = "30"
Name = ". aspxauth"
Path = "/"
Requiressl = "false"
Slidingexpiration = "true"
Defaulturl = "default. aspx"
Cookieless = "usedeviceprofile"
Enablecrossappredirects = "false"/>
</Authentication>
All users must log on to Alibaba Cloud
<Authorization>
<Deny users = "? "/>
</Authorization>
Allow all regions to be accessed
<Allow users = "*"/>
Permission Restriction
<Allow Users= "Admin"/>
<Deny Users= "*"/>
Specify the contentsProgramPermission
<Location Path = "public">
<System. Web>
<Authorization>
<Allow users = "*"/>
</Authorization>
</System. Web>
</Location>
<Location Path = "managesys">
<System. Web>
<Authorization>
<Allow users = "admin"/>
<Deny users = "*"/>
</Authorization>
</System. Web>
</Location>
Specify a specific program
<Location Path = "managesys/auditing. aspx">
. CS Program
System. Web. Security. formsauthentication. redirectfromloginpage (this. textbox1.text, false );
Access the interface opened by the program.
System. Web. Security. formsauthentication. setauthcookie (this. textbox1.text, false );
Response. Redirect ("default. aspx ");
Merge to the specified plane
If (user. Identity. isauthenticated)
{
Response. Write ("logged ");
}
Determines whether a logon is successful in a program.
System. Web. Security. formsauthentication. signout ();
Logout