SystemInformation.ComputerName

   
 
using System;
using System.Drawing;
using System.Windows.Forms;
   
class MainClass{
     public static void Main()
     {
   
          Console.WriteLine(SystemInformation.ComputerName);
     }
}