System.Web.HttpContext.Current ... [英] System.Web.HttpContext.Current...
问题描述
嗨朋友
我真的很期待得到帮助,尽管我已经在互联网上找到了大量的解决方案,但没有任何工作。
我的问题是我在4.0 c#中开发应用程序并且在记录时,我没有提示登录屏幕,而是通过
$ b获取当前用户$ b
Hi Friends
I really looking forward for assistance , even though I have found tons of solution over the internet but nothing has work.
My problem is I have develop the application in 4.0 c# and while logging , I am not prompting the Login screen but taking the current user by
System.Web.HttpContext.Current.User.Identity.Name.ToString();
通过Visual Studio工作,但当我在IIS中部署应用程序时,我将其视为空白
<我在iis中使用了
,我已经禁用了自治身份验证并启用了Windows身份验证,我的网络配置设置如下:
its working in via Visual studio , but when I deploy the application in IIS , I am getting it as blank
in iis , I have disabled Anonomous authentication and have enable Windows Authentication , and my web config setting is as below
<authentication mode="Windows"/>
<authorization>
<deny users ="?"/>
</authorization>
<identity impersonate="true"/>
<customErrors mode="Off"/>
<!--
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<httpHandlers>
</httpHandlers>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
</system.webServer>
任何人都可以给我解决方案我必须做什么设置让它工作
谢谢
Can anyone one pls give me the solution what setting I have to do it get it worked
Thanks
推荐答案
当您使用本地计算机时,您将以自己的身份登录。部署到服务器时,该服务器以与本地计算机不同的人身份登录。我打赌那是你的问题。您的服务器上还没有当前用户,您需要先登录。
When you use your local machine, you are logged in as yourself. When you deploy to a server, that server is logged in as someone different to your local machine. I bet that is your problem. You don't have a current user on your server yet, you'd need to log in first.
这篇关于System.Web.HttpContext.Current ...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!