Question:
How to obtain the current username in using C#.NET applications?Answer:
Use C#to retrieve the current username in .NET, you can use the class. The code is as follows:
This code retrieves the current username and assigns it to variables. System.Security.Principal.WindowsIdentity
Method Return to the class instance, which represents the identity of the current thread user. By calling the attribute of this object, you can access the name of the user.
The above is the detailed content of How to Get the Current User's Name in a .NET C# Application?. For more information, please follow other related articles on the PHP Chinese website!