protected void btnSubmit_Click(object sender, EventArgs e)
{
string strHostName = string.Empty;
strHostName = Dns.GetHostName();
IPHostEntry ipEntry = Dns.GetHostByName(strHostName);
IPAddress[] addr = ipEntry.AddressList;
for (int i = 0; i < addr.Length; i++)
{
txtIPs.Text = ("IP Address " + i + addr[i].ToString() + ", HostName: " + strHostName);
}
SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["ConStr"]);
SqlDataAdapter da = new SqlDataAdapter("Insert Into pew(name,ip)values('"+txtName.Text+"','" +txtIPs.Text+ "')", con);
DataSet ds = new DataSet();
da.Fill(ds);
txtName.Text = "";
lblStatus.Text = "Data Successfully Inserted";
}
Please Give me the code of get the host name when i put the website in IIS Server its urgent.I have already use this code & get the computer name but when host in IIS than it display only server name. i want to know everyone computer name which i forward the link plz