VB怎么实现显示本机IP?

来源:百度知道 编辑:UC知道 时间:2024/07/02 00:13:59
想在软件中实现这个功能,不知道应该用什么函数。。。

Private Sub Command1_Click()
ip_gw = Inet1.OpenURL("http://www.ip138.com")
ip_gw = Mid$(ip_gw, InStr(ip_gw, "您的IP地址是"), 22)
ip_gw = Replace(ip_gw, "您的IP地址是", "")
ip_gw = Replace(ip_gw, ":", "")
ip_gw = Replace(ip_gw, "'", "")
ip_gw = Replace(ip_gw, ":", "")
ip_gw = Replace(ip_gw, "<", "")
ip_gw = Replace(ip_gw, ">", "")
ip_gw = Replace(ip_gw, "/", "")
ip_gw = Replace(ip_gw, "f", "")
ip_gw = Replace(ip_gw, "o", "")
ip_gw = Replace(ip_gw, "r", "")
ip_gw = Replace(ip_gw, "t", "")
ip_gw = Replace(ip_gw, "p", "")
ip_gw = Replace(ip_gw, "d", "")
Text1.