Search code examples
c#hostname

How do I get the local machine name in C#?


How do I get the local machine name?


Solution

  • System.Environment.MachineName

    It works unless a machine name has more than 15 characters.