最新.net2.0获取本机IP等信息
为了得到Client电脑的信息,我在网上搜了很多关于怎样获取客户端信息的资料,但都没有一个能在VS.NET2005下能编译通过的,后来自己琢磨出来了,如下:
Public Function getUserHostAddress() As String
If strUserHostAddress = "" Then
Dim name As String = Dns.GetHostName()
Dim entry As IPHostEntry = Dns.GetHostEntry(name) '跟net1.1是有区别的
strUserHostAddress = entry.AddressList(0).ToString()
End If
Return strUserHostAddress
End Function

浙公网安备 33010602011771号