4
Answers

How to get the system name using C#?

Raja

Raja

7y
421
1
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)