Public Sub GetMyIP()
Dim strComputer As String Dim objWMI As Object Dim colIP As Object Dim IP As Object Dim i As Integer strComputer = "." Set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colIP = objWMI.ExecQuery _ ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE") For Each IP In colIP If Not IsNull(IP.IPAddress) Then For i = LBound(IP.IPAddress) To UBound(IP.IPAddress) MsgBox IP.IPAddress(i), vbInformation, IP.Description(i) Next End If Next MsgBox "Excel版本信息为:" & Application.CalculationVersion MsgBox "Excel当前允许使用的内存为:" & Application.MemoryFree MsgBox "Excel当前已使用的内存为:" & Application.MemoryUsed MsgBox "Excel可以使用的内存为:" & Application.MemoryTotal MsgBox "本机操作系统的名称和版本为:" & Application.OperatingSystem MsgBox "本产品所登记的组织名为:" & Application.OrganizationName MsgBox "当前用户名为:" & Application.UserName MsgBox "当前使用的Excel版本为:" & Application.Version End Sub |
|