4
Reply

How to get the system name using C#?

Raja

Raja

Feb 9 2017 6:28 AM
398
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)