Asp.net获取本机计算机名称
asp.net吧
全部回复
仅看楼主
level 3

Asp.net
获取本机计算机名称
2012年12月03日 03点12分 1
level 3
有知情人士嘛?
2012年12月03日 12点12分 2
level 4

asp.net获取本机计算机名和IP
protected void Page_Load(object sender, EventArgs e)
{
string strHostIP = ""; //本机IP
string strHostName = ""; //本机名称
strHostName = Environment.MachineName;
IPHostEntry objIPHost = Dns.GetHostEntry(strHostName);
if (objIPHost.AddressList.Length > 0)
strHostIP = objIPHost.AddressList[0].ToString();
this.TextBox1.Text = strHostName;
this.TextBox2.Text = strHostIP;
}
2012年12月06日 06点12分 3
此方法只能获取服务器端的IP地址,无法获取本机的IP地址
2012年12月11日 02点12分
level 7
System.Net.Dns.GetHostName()
2012年12月24日 06点12分 4
无效
2012年12月26日 05点12分
level 2
获取客户端计算机硬件信息与系统信息JS全搞定http://blog.csdn.net/chinafe/article/details/8194306
2012年12月28日 03点12分 5
level 1
1.使用Request.UserHostName,如果取出来的不是名称是ip,用下面的方法:
string ip =Request.UserHostName;
var entry= System.Net.Dns.GetHostEntry(ip);
var name=entry.HostName;
2012年12月28日 07点12分 6
level 6
学习了
2012年12月31日 04点12分 7
level 11
路过 打酱油、、、、
2012年12月31日 05点12分 8
1