获取用户名客户端C# [英] Get username client side C#

查看:85
本文介绍了获取用户名客户端C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASP.net Web应用程序(在VS中编写),它在服务器上托管。此Web应用程序是我的Outlook加载项。我想获取登录到Outlook应用程序的用户名。当我尝试使用模拟时,插件无法加载。默认情况下,用户名不需要授权登录。

任何人都可以帮忙吗?



我尝试过:



我尝试了很多方法但没有成功(禁用匿名身份验证并启用Windows身份验证,User.Identity.Name等。)

I have an ASP.net 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#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆