菜鸟关于Form验证的问题
<?xml version= "1.0 " encoding= "utf-8 " ?>
<configuration>
<system.web>
<httpRuntime
maxRequestLength= "4096 "
executionTimeout= "600 "
/>
<compilation
defaultLanguage= "c# "
debug= "true "
/>
<sessionState
mode= "InProc "
stateConnectionString= "tcpip=127.0.0.1:42424 "
sqlConnectionString= "server=(local);database=vod;Trusted_Connection=yes; "
cookieless= "false "
timeout= "20 "
/>
<globalization
requestEncoding= "utf-8 "
responseEncoding= "utf-8 "
/>
</system.web>
<appSettings>
<add key= "strConnection " value= "server=(local);database=vod;Persist Security Info=True;Password=;User ID=sa; " />
<add key= "Manager " value= "magicevy " />
</appSettings>
</configuration>
问题1:
这是web.config文件,我要做form验证,验证登录上的用户使用资源。要怎么改啊?
==========================================================================
<authentication mode= "Forms ">
<forms loginUrl= "Left.aspx " name= ".ASPXAUTH "> </forms>
</authentication>
<authorization> <deny users= "? "> </deny> </authorization>
问题2:
name= ".ASPXAUTH "是指什么?
[解决办法]
1. <authentication mode= "Forms "> <forms loginUrl= "Left.aspx " name= ".ASPXAUTH "> </forms> </authentication> <authorization> <deny users= "? "> </deny> </authorization> 定一段放在web.config中就可2. form的名称.
[解决办法]
1、如上面的五星所说
2、应该是代表验证成功之后生成的验证Cookie的名字吧~
[解决办法]
晕 不是光设置就可以实现的登录,那还要我们这些聪明的程序员干什么
要在后台写登录后写入cookie等代码的,而且如果有自定义的部分,还要在httpmodule中进行cookie的读取判断,建议在微软网站上搜索一下,有标准的实现的。