- ©«¤l
- 549
- ¥DÃD
- 152
- ºëµØ
- 0
- ¿n¤À
- 691
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN7
- ³nÅ骩¥»
- OFFICE 2010
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2013-8-10
- ³Ì«áµn¿ý
- 2022-9-7
 
|
[µo°Ý] ¬°¦óVBA¬d¸ßªºIP»P¹ê»Úºô¶¤W¬d¸ßªºIP¤£¦P?
¤£¦n·N«ä³Â·Ð¦U¦ì¤j¤j,
¤p§Ì¤w¸g§ä¨ì¤j¬ù¤QÓ¥i¥H¬d¸ß¨ìIPªºVBAµ{¦¡½X(·íµM¦³³\¦h«½Æªº)
¦ý¬d¸ßµ²ªG³£¬O192.168.xx.xx
¥i¬O¤p§Ìnªº¬O¤U¤èºô¯¸
http://dir.twseo.org/ip-check.php
©Ò¬d¸ß¥X¨ÓªºIP=42.72.5.xxx
¬°¦ó©Ò¦³VBAµ{¦¡½X¬d¸ß¥X¨Óªº³£¸òºô¶¬d¸ßªºIP¤£¦P?¨Ò¦p¤U¤èµ{¦¡½X- 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
- strIPAddress = strIPAddress & Join(IPAddress, ", ")
- End If
- Next
- MsgBox strIPAddress
- End Function
½Æ»s¥N½X ¦U¦ì¤j¤j¥i¦Û¦æ´ú¸Õ¬Ý¬Ý³o¨âºØ¤è¦¡
·|¬d¸ß¥X¨âºØ¤£¦PªºIP
n¦p¦ó¤~¯à°÷¬d¸ß¨ìºô¶ªº¨ººØIP¦ì¸m©O? |
|