获取用户名客户端C#

编程入门 行业动态 更新时间:2024-10-28 08:22:27
本文介绍了获取用户名客户端C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个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#

本文发布于:2023-11-09 17:11:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1572948.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:客户端   用户名

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!