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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top