📜  vb 获取 ip 地址 - VBA 代码示例

📅  最后修改于: 2022-03-11 14:51:53.450000             🧑  作者: Mango

代码示例1
Private Sub GetIPAddress()

Dim strHostName As String

Dim strIPAddress As String



strHostName = System.Net.Dns.GetHostName()

strIPAddress = System.Net.Dns.GetHostByName(strHostName).AddressList(0).ToString()


MessageBox.Show("Host Name: " & strHostName & "; IP Address: " & strIPAddress)

End Sub