我有一个ASP Web应用程序(在VS中编写),它在服务器上托管。此Web应用程序是我的Outlook加载项。我想获取登录到Outlook应用程序的用户名。当我尝试使用模拟时,插件无法加载。默认情况下,用户名不需要授权登录。 任何人都可以帮忙吗? 我尝试过: 我尝试了很多方法但没有成功(禁用匿名身份验证并启用Windows身份验证,User.Identity.Name等。)
I have an ASP web application (wrote in VS) which is being hosted on a server. This web application is my Outlook add-in. I want to get the username logged in to the Outlook application. The plugin does not load when I try to use impersonation. By default, the username should not require an authorization login. Can anyone assist with this? What I have tried: I have tried many methods but without success (disable anonymous authentication and enable windows authentication, User.Identity.Name etc.)
推荐答案您在服务器上执行的任何操作都不会将名称发送给客户端。您需要在服务器上发现它,如果这是可能的,并将其发送到客户端。但是,除非客户端告诉他们,否则服务器将不知道谁正在使用该页面。如果您正在寻找AD或类似的东西,那么您就误解了服务器和客户端之间的障碍。如果客户端尚未登录,则他们不会登录到您的站点,也无法知道他们是谁。正如理查德所说,你需要问他们 Nothing you do on the server will send the name to the client. You need to discover it on the server, if that's somehow possible, and send it to the client. However, the server won't know who is using the page, unless the client told them. If you're looking for something from AD, or similar, then you've misunderstood the barrier between server and client. If the client has not logged in, they are not logged in to your site, and you have no way of knowing who they are. As Richard said, you will need to ask them
更多推荐
获取用户名客户端C#
发布评论