how to get the computerName?

  • Thread starter Thread starter Jason Shohet
  • Start date Start date
J

Jason Shohet

Is there a way in C# to get the name of the computer (ie, rt-clicking
MyComputer, properties, computer name) ? I don't mind doing it in ASP.NET
or Windows Forms. We don't have NetBios turned on, i don't know if that
makes a difference.

TY for any help / sample code
Jason Shohet
 
Jason,

You should be able to use the static MachineName property on the
Environment class to get the machine name.

It should work even if NETBIOS isn't turned on (your machine name is
stored locally).

Hope this helps.
 
Back
Top