January 2, 2016 HomeC# QuestionsHow to Get Computer Name in C#/CSharp How to Get Computer Name in C#/CSharp By Krishnaa C# Questions 0 Comments To get computer name in C#/CSharp, we make use of Environment class and its property MachineName. Example is given below. using System; namespace Hello_World { class Program { static void Main(string[] args) { Console.WriteLine(Environment.MachineName); } } } You May Also Like: How to Trim a String in C#/CSharp How to Sort An Array in C#/CSharp How to Get File Size in C#/CSharp How to Generate GUID in C#/CSharp How to Get Application Path in C#/CSharp