.NET:在asp.net中认识的web.config [英] .NET: understanding web.config in asp.net
问题描述
有谁知道一个很好的链接来解释如何使用web.config中......
例如,我使用窗体身份验证......我注意到有一个System.Web程序,然后关门/system.web,然后在下面配置有额外的位置标记
下面是一个例子,如果你ntoice有一个身份验证模式,授权=形式我presume这根.......这也是包含在System.Web程序中的自我....下面这个有多个位置=使用的System.Web标签....
我从来没有真正明白我实际上做。我已经试过checkign MSDN文档但我仍然不完全了解了....
谁能帮助?
如果你用我的例子....一切都存储在web.config中1通知...我想标准的WAAS创建一个标准的web.config文件,然后在目录中创建另一个web.config文件在这里我要保护它.. ???
<结构> <&的System.Web GT;
<编译调试=真正的严=false的明确=真targetFramework =4.0/> <身份验证模式=表格>
<形式loginUrl =的Login.aspxdefaultUrl =的Login.aspx无Cookie =UseCookies超时=60/>
< /认证> <授权>
<让用户=*/>
< /授权> < /system.web>
<位置路径=表格>
<&的System.Web GT;
<授权>
<拒绝用户= /&gt的帮助?
<让用户=*/>
< /授权>
< /system.web>
< /地点>
<位置路径=表格/ SEGURIDAD>
<&的System.Web GT;
<授权>
<让角色=Administrador/>
<拒绝用户= /&gt的帮助?
< /授权>
< /system.web>
< /地点>
标准条目(web.config中是可扩展的)是有据可查的在其中。
http://msdn.microsoft.com/en-us/library/ aa719558.aspx
是一个好的开始。
这是 - 作为应该是显而易见的 - 基于XML的,顺便说一句
Does anyone know of a good link to explain how to use the web.config......
For example, i am using forms authentication... and i notice there is a system.web and then it closed /system.web and then below configuration there are additional location tags
here is an example, if you ntoice there is an authentication mode=forms with authorization i presume this is the ROOT....... It is also self contained within a system.web .... Below this there are more location= with system.web tags....
I have never really understand what i am actually doing.. I have tried checkign the MSDN documentation but still i don't fully understand up....
Can anyone help?
If you notice with my example.... everything is stored in 1 web.config... i thought the standard waas create a standard web.config and then create another web.config in the directory where i wish to protect it..???
<configuration>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
<authentication mode="Forms">
<forms loginUrl="Login.aspx" defaultUrl="Login.aspx" cookieless="UseCookies" timeout="60"/>
</authentication>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
<location path="Forms">
<system.web>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="Forms/Seguridad">
<system.web>
<authorization>
<allow roles="Administrador"/>
<deny users="?"/>
</authorization>
</system.web>
</location>
Standard entries (web.config is extensible) are well documented therein.
http://msdn.microsoft.com/en-us/library/aa719558.aspx
is a good start.
It is - as should be obvious - XML based, btw.
这篇关于.NET:在asp.net中认识的web.config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!