Dim aa As String Dim strLocalIP As String Dim winIP As Object aa = aa & "本机电脑名称:" & Environ("computername") & vbCrLf aa = aa & "本机用户名称:" & Environ("username") & vbCrLf Set winIP = CreateObject("MSWinsock.Winsock") strLocalIP = winIP.localip MsgBox aa & "本机IP:" & strLocalIP
很简单的哈?