如何捕获客户端的窗口用户名

本文关键字:用户 窗口 何捕获 客户端 | 更新日期: 2023-09-27 18:33:56

我正在尝试制作一个应用程序,我需要在其中捕获访问它的客户端的Windows用户名。有人可以帮助我吗.这是一个网络应用程序。提前谢谢。

如何捕获客户端的窗口用户名

我在我的 devops 网站上使用它来获取有关客户端工作站的信息:

    string a1 = Request.ServerVariables["REMOTE_ADDR"];
    Label1.Text = "Microsoft & Browser Settings: 't" + Request.UserAgent;
    Label2.Text = "Web Server IP: " + HttpContext.Current.Request.ServerVariables["LOCAL_ADDR"];
    Label3.Text = "Request Server DNS: " + Request.ServerVariables["REMOTE_ADDR"];
    Label4.Text = "Request Host Address DNS: " + Request.UserHostAddress;
    Label5.Text = "Request Host Name DNS: " + Request.UserHostName;
    Label6.Text = "DNS Forwarding Address: " + Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
    Label7.Text = "Windows ID Owner : " + WindowsIdentity.GetCurrent().Owner.ToString();
    string[] computer_name = System.Net.Dns.GetHostEntry(Request.ServerVariables["remote_addr"]).HostName.Split(new Char[] { '.' });
    Label8.Text = "Computer Name: " + computer_name[0].ToString();
    Label9.Text = "Request Host Name DNS: " + Request.UserHostName;
    Label10.Text = "Is Local: " + Request.IsLocal.ToString();
    Label11.Text = "URL: " + Request.Url.ToString();

你想要窗口ID所有者,如果有帮助,请标记答案