Wednesday 11 September 2019

How do I get the current username in .NET using C#?



How do I get the current username in .NET using C#?


Answer



string userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...