How to get machine name in asp.net c#

In this article, we learn how to get  machine name or computer name in asp.net c# as you can also learn how to get How to Get Current Location (Country, State, and City) Name Using JavaScript in Asp.Net but here we use google API



Some methods are given below to get machine name or computer name


Method 1:-
string MachineName1 = Environment.MachineName;
Method 2:-
string MachineName2 = System.Net.Dns.GetHostName();
Method 3:-
string MachineName3 = Request.ServerVariables["REMOTE_HOST"].ToString();

Method 4:-
       string MachineName4 = System.Environment.GetEnvironmentVariable("COMPUTERNAME");


Out-Put:-




How to get machine name in asp.net c# How to get machine name in asp.net c# Reviewed by NEERAJ SRIVASTAVA on 3:07:00 PM Rating: 5

No comments:

Powered by Blogger.