具体例码,这里是form格式的登陆
windows格式的在IIS中设置
webconfig:
<authentication mode="Forms">
<forms name="mylogin" loginUrl="login.aspx">
<credentials passwordFormat="HA1">
</credentials>
</forms>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
<configuration>
<system.web>
<trace enabled="true" />
<authentication mode="Forms">
<forms name="asdasdasd" loginUrl="login.aspx" />
</authentication>
<authorization>
<deny users="?" />----不允许匿名
<allow users="pipp" />----允许pipp
<deny users="*" />----不允许所有用户
</authorization>
</system.web>
</configuration>