get current computer name csharp

Code Example - get current computer name csharp

                
                        System.Environment.MachineName //from a console or WinForms app.
HttpContext.Current.Server.MachineName //from a web app
System.Net.Dns.GetHostName() //to get the FQDN