Raja

Raja

  • NA
  • 1.7k
  • 43.1k

How to get the system name using C#?

Feb 9 2017 6:28 AM
i want to implement single sign on for my application 
I want to get current pc user name using asp.net c#
i host my application in server.

What I have tried:


i use the below codes but the function get the user name of server PC i want to get user name of current pc how to do it? 

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


Answers (4)