How to Get Server Computer Name in Asp.Net?

 Posted by Vishalneeraj-24503 on 3/1/2015 | Category: ASP.NET Interview questions | Views: 1624 | Points: 40

To get computer name of our Web Server with Asp.Net Server Side code,first we need to add a reference to System.Windows.Forms Namespace and then use code like this:-
using System.Windows.Forms;

protected void Page_Load(object sender, EventArgs e)
string Server_Name = String.Empty;
Server_Name = SystemInformation.ComputerName;

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response