If you want to use forms to verify the files in a directory or a file, follow these steps:
Add the following configuration section under the <configuration> section of Web. config:
1 <Location Path = "frmregister. aspx"> <! -- If the path here is a folder, the files in the folder do not need to be verified. For example, if Path = "public", all files in public are not verified, if Path = "pubilc/index. aspx "indicates public/index. aspx file not verified -->
2 <system. Web>
3 <authorization>
4 <allow users = "*"/>
5 </authorization>
6 </system. Web>
7 </location>
In the <system. Web> Configuration section, add the following configuration section: 1 <Authentication mode = "forms">
2 <forms name = ". loginuser" loginurl = "default. aspx" Protection = "all" timeout = "30"/>
3 </authentication>
4 <authorization>
5 <deny users = "? "/>
6 <allow users = "*"/>
7 </authorization>
The verification results can be achieved. The code is very simple and will not be explained.