Imports System.Net.Dns
Public Function GetIPaddress() As String
Try
Dim ipEntry As System.Net.IPHostEntry = GetHostByName(Environment.MachineName)
Dim IpAddr As System.Net.IPAddress() = ipEntry.AddressList
GetIPaddress = IpAddr(0).ToString
Catch ex As Exception
GetIPaddress = "無法取得IP"
End Try
End Function
沒有留言:
張貼留言