前端之家收集整理的这篇文章主要介绍了
[VB.NET]如何获取主机名,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
- DimhostInfoAsSystem.Net.IPHostEntry=System.Net.Dns.GetHostByName(TextBox1.Text)
- MessageBox.Show(hostInfo.AddressList(0).ToString,"主机地址",MessageBoxButtons.OK,MessageBoxIcon.Exclamation)
- DimmyIPAsSystem.Net.IPAddress=System.Net.IPAddress.Parse(TextBox2.Text)
- DimhostInfoAsSystem.Net.IPHostEntry=System.Net.Dns.GetHostByAddress(myIP)
- MessageBox.Show(hostInfo.HostName.ToString,"主机域名",MessageBoxIcon.Exclamation)
原文链接:https://www.f2er.com/vb/264407.html