Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
实际上我想显示在窗口上登录的用户。但是当我编写这个参数并在内联网上运行时
WindowsIdentity.GetCurrent().Name;
然后它显示
NT AUTHORITY\IUSR
我想显示用户名。当我通过 VB 软件运行时,它显示窗口用户名。
你应该使用User.Identity.Name:
User.Identity.Name
If User.Identity.IsAuthenticated Then Label1.Text = User.Identity.Name Else Label1.Text = "Anonymous user" End If