First, describe the web.config file.
XML Version = "1.0" encoding = "UTF-8"?>
Set compilation debug = "true" to debug symbol (.pdb information)
Insert into the compiled page. Because this will be created
Slow big file, so you should only set this value to true when debugging, and all other times are set to
False. For more information, please refer to
debugging
ASP.NET file documentation.
->
Set CustomerRors Mode = "ON" or "Remoteonly" to enable custom error messages, or set to "OFF" to disable custom error messages.
Add
->
This section sets the application's authentication policy. Possible mode is "windows",
"Forms", "Passport" and "NONE"
->
This section sets the authorization policy for the application. Can allow or reject users or roles to access
Application resources. Wildcard: "*" means anyone, "?" Indicates anonymous
(Unauthorized) users.
->
Roles = "[comma-separated list]" />
Roles = "[comma-separated list]" /> -> Authorization>
Application Level Track Enables trace log output for each page in the application. Set Trace Enabled = "True" to enable application tracking records. If Pageoutput = "True", then The tracking information will be displayed at the bottom of each page. Otherwise, you can pass from the web application Root browsing "TRACE.AXD" page Application trace log. -> By default, ASP.NET uses a cookie to identify which requests belong to a specific session. If the cookie is not available, you can track the session by adding a session identifier to the URL. To disable cookies, set sessionState cookieless = "true". -> Mode = "inproc" StateConnectionstring = "TCPIP = 127.0.0.1: 42424" SqlConnectionstring = "data source = 127.0.0.1; user ID = sa; pass Word = " Cookieles = "false" TIMEOUT = "20" />
This section sets the application's global setting. -> Configure> Ok, I believe that after reading the introduction above, I must know very well for web.config files. Below we will cut theme. In order to prevent the user from accessing the site without verifying, our processing method is when the user does not pass the validation, click any page to be jumped directly to the login.aspx page, the specific code is as follows: protection = "all" pat = "/" /> Authentication> Authorization> But this will generate a problem, that is, if I have some information that can be freely accessed by any user, such as the site introduction, instructions, etc. If you don't let users feel troublesome, huh, huh, not anxious, naturally have a corresponding solution in ASP.NET. The following code can implement anonymous user access Test.aspx page: Authorization> location> Solved the two questions above, I believe that everyone must have it. The Login.aspx page is started below. Use C # and SQL Server2000 to create a WebForm page, join the appropriate controls. The specific code is as follows: <% @ Page language = "c #" codebehind = "login.aspx.cs" Autoeventwireup = "false" inherits = "secure.login"%>
Name = "vs_targetschema"> HEAD>