表单身份验证(受保护的目录)
生活随笔
收集整理的這篇文章主要介紹了
表单身份验证(受保护的目录)
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
根目錄下的 web.config
<authentication?mode="Forms">???<forms?name=".COOKIEDEMO"?loginUrl="bb.aspx"?protection="All"
???timeout="60"?path="/">?
??????</forms>?
????????</authentication>?根目錄下的.?
?bb.aspx
if?(this.TextBox1?.Text=="abc"?&&??this.TextBox2?.Text=="abc")
????????????{
????????????????System.Web.Security?.FormsAuthentication?.RedirectFromLoginPage(this.TextBox1?.Text,false);
????????????????
????????????}
????????????else
????????????{
????????????}
? 根目錄下新建一個(gè)受保護(hù)的目錄...
??? 這個(gè)目錄下的 web.config?
?? <configuration>
??<system.web>
????<authorization>
??????<deny?users="?"?/>
????</authorization>
??</system.web>
</configuration>?
demo
? http://files.cnblogs.com/gwazy/WebApplication7.rar
<authentication?mode="Forms">???<forms?name=".COOKIEDEMO"?loginUrl="bb.aspx"?protection="All"
???timeout="60"?path="/">?
??????</forms>?
????????</authentication>?根目錄下的.?
?bb.aspx
if?(this.TextBox1?.Text=="abc"?&&??this.TextBox2?.Text=="abc")
????????????{
????????????????System.Web.Security?.FormsAuthentication?.RedirectFromLoginPage(this.TextBox1?.Text,false);
????????????????
????????????}
????????????else
????????????{
????????????}
? 根目錄下新建一個(gè)受保護(hù)的目錄...
??? 這個(gè)目錄下的 web.config?
?? <configuration>
??<system.web>
????<authorization>
??????<deny?users="?"?/>
????</authorization>
??</system.web>
</configuration>?
demo
? http://files.cnblogs.com/gwazy/WebApplication7.rar
轉(zhuǎn)載于:https://www.cnblogs.com/gwazy/archive/2005/03/04/112643.html
總結(jié)
以上是生活随笔為你收集整理的表单身份验证(受保护的目录)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 监测磁盘文件是否被修改程序
- 下一篇: 傻X的陈天桥