-1

I want to get the computer name in the live.means suppose if any one open my site i want to get his system name. In a work group also i want to get the name of system not workgroup name.

I have did so many link but all are working for local when i host that won't.

Here is my code:

UserName = WindowsIdentity.GetCurrent().Name.ToString(); 

In the local it is working when i post that into server That will not get the system name. Please help me.

Nava2011
  • 195
  • 1
  • 15

1 Answers1

0

I'm not sure that i understand you well, but there are many ways to do so, and here's what i know:

WindowsIdentity.GetCurrent().Name;

or

Thread.CurrentPrincipal.Identity.Name;

or

Environment.UserName;
Enumy
  • 841
  • 2
  • 8
  • 20