ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¬°¦óVBA¬d¸ßªºIP»P¹ê»Úºô­¶¤W¬d¸ßªºIP¤£¦P?

Function GetIPAddress()
        Const strComputer As String = "."   ' Computer name. Dot means local computer
        Dim objWMIService, IPConfigSet, IPConfig, IPAddress, i
        Dim strIPAddress As String

        ' Connect to the WMI service
        Set objWMIService = GetObject("winmgmts:" _
            & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

        ' Get all TCP/IP-enabled network adapters
        Set IPConfigSet = objWMIService.ExecQuery _
            ("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")

        ' Get all IP addresses associated with these adapters
        For Each IPConfig In IPConfigSet
            IPAddress = IPConfig.IPAddress
            If Not IsNull(IPAddress) Then
                If InStr(1, IPConfig.Description, "WAN (", vbTextCompare) Then
                   MsgBox "ºô­¶ IP = " + IPAddress(0)
                End If
                strIPAddress = strIPAddress & Join(IPAddress, "/") + vbCrLf
            End If
        Next

        MsgBox strIPAddress
    End Function

TOP

¥H§Úªº¬°¨Ò
IPConfig.Description

WAN (PPP/SLIP) Interface  '¼eÀW
Realtek RTL8168/8111 PCI-E Gigabit Ethernet NIC - Packet Scheduler Miniport  ' ¥D¾÷ªO¤Wªº¤º«Øºô¥d
VMware Virtual Ethernet Adapter for VMnet1  'µêÀÀ¾÷¤WªºµêÀÀ¥d
VMware Virtual Ethernet Adapter for VMnet8  'µêÀÀ¾÷¤WªºµêÀÀ¥d

TOP

¥»©«³Ì«á¥Ñ jackyq ©ó 2016-2-29 12:40 ½s¿è







¥´¤J  ipconfig  ¬Ý¬Ý¦³µL¥X²{§A­nªºip­È

TOP

¥»©«³Ì«á¥Ñ jackyq ©ó 2016-2-29 21:11 ½s¿è

¥i¥H¦Ò¼{¥Î§@¹ú¤èªk
§ìºô­¶¤º®e  http://dir.twseo.org/ip-check.php

TOP

        ÀR«ä¦Û¦b : ¦n¨Æ­n´£±o°_¡A¬O«D­n©ñ±o¤U¡A¦¨´N§O¤H§Y¬O¦¨´N¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD