每次我必须使用IIS7为ASP.NET添加处理程序或模块时,指令总是告诉我将它合并为两个部分:system.web和system.webserver.
<system.web>
    <httpHandlers>
    </httpHandlers>
    <httpModules>
    </httpModules>
</system.web>
还有这个:
<system.webServer>
    <modules>
    </modules>
    <handlers>
    </handlers>
</system.webServer>
这两个部分有什么区别?
此外,如果我不将它添加到该system.web部分,我的Visual Studio 2008调试器也无法正常工作.
我正在运行一个需要能够读取当前用户的登录ID的网页.这是我正在使用的代码:
string id = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
目前,这将返回正确的登录,但是当我在此方法中使用它时:
protected Boolean isPageOwner()
{
    string id = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
    alert("User: " + id);
    if (id.Equals(pageOwnerID))
    {
        return true;
    }
    if (accessPermission.ContainsKey(id))
    {
        return true;
    }
    return false;
}
即使返回的id与pageOwnerID相同,该方法也返回false.我真的不确定我遇到问题的哪一部分.
另外,我的登录ID的格式为string1/string2,但代码将其检索为string1 + string2而不使用斜杠.
任何建议表示赞赏.
问候.
我在IIS 8上部署了一个具有表单身份验证模式的应用程序.现在有一个要求,即如果Windows用户和应用程序用户不同,企业希望显示弹出消息并创建审核日志.
为此,我想在应用程序的logincontrol上获取Windows登录用户.我尝试了很多方法但没有任何帮助.
如果可能,请指导我.
伙计们..请帮帮我......