如何使用c#获取Windows客户端用户的NT ID [英] how to get NT ID of the windows Client user by using c#

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

问题描述

亲爱的所有人,



我使用以下代码获取内网应用程序的NT ID









string CurrentUser1;

CurrentUser1 = System.Security.Principal.WindowsIdentity.GetCurrent( ).Name.ToString();

string [] Cuser1 = CurrentUser1.Split('\\');



回复.Write(@< script language ='javascript'> alert('ICICI USERNAME:\ n+ Cuser1 [1] .ToString()+。ICICI:\ n+ CurrentUser1 +。') ;< /脚本>中);



它在本地开发系统中工作正常,但是当我在现场部署它时会出现问题,它正在获取服务器的ID及其难以理解的错误。



任何人都可以让我如何获得客户端系统NT ID。



Plz让我知道如何解决这个。

Dear All,

I am using the following code to get the NT ID for my intranet application




string CurrentUser1;
CurrentUser1 = System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString();
string[] Cuser1 = CurrentUser1.Split('\\');

Response.Write(@"<script language='javascript'>alert('ICICI USERNAME: \n" + Cuser1[1].ToString() + " .ICICI: \n" + CurrentUser1 + " .');</script>");

It is working fine in the local development system, But problem arises when I deployed on live it is taking the ID of the server and its toughing error.

Can any one let me how to get the client system NT ID .

Plz let me know how to solve this.

推荐答案

阅读这些:

http://stackoverflow.com/questions/19676312/how-to-get-user-name-using-windows-authentication-in- asp-net [ ^ ]



http://forums.asp.net/t/1598421.aspx?Getting+windows+username+using+windows+authentication [ ^ ]
Read these:
http://stackoverflow.com/questions/19676312/how-to-get-user-name-using-windows-authentication-in-asp-net[^]

http://forums.asp.net/t/1598421.aspx?Getting+windows+username+using+windows+authentication[^]


这篇关于如何使用c#获取Windows客户端用户的NT ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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