¬R±o¸ê°T¤u§@«Ç
³Â»¶¾Ç¶é
Åwªï¥úÁ{, ³X«È. ½Ð¥ý µn¤J ©Î µù¥U¤@­Ó±b¸¹.
±z§Ñ¤F ±Ò¥Î±zªº±b¸¹¶Ü?
2008-07-09, 12:41:18
­º­¶ »¡©ú µn¤J µù¥U ÃÙ§U½×¾Â ·Q·í§@ªÌ?
·s»D: Wink¦³ÃÙ§U¥»½×¾Â¸gÀ窺·|­û,½Ð°È¥²¨Ó«H³qª¾¤p»x,³o¼Ë¤~¯à¬°±z§ó·s·|­û¸s²Õ³á!!


+  ³Â»¶®a±Ú°Q½×°Ï
|-+  MS Office ¨t¦C
| |-+  EXCEL
| | |-+  Excelµ{¦¡°Ï (ª©¥D: hsieh)
| | | |-+  ¨ú±o¨t²Î¸ê°T/¨Ï¥ÎªÌ¸ê°T
0 ·|­û ¥H¤Î 1 ³X«È ¥¿¦b¾\Ū¥»½g¥DÃD. « ¤W¤@½g¥DÃD ¤U¤@½g¥DÃD »
­¶: [1] ¦V¤U ¦C¦L
§@ªÌ ¥DÃD: ¨ú±o¨t²Î¸ê°T/¨Ï¥ÎªÌ¸ê°T  (¾\Ū 1987 ¦¸)
leonchou
½×¾ÂºûÅ@¸s
*
Â÷½u Â÷½u

¤å³¹: 1160


¨ú±o¨t²Î¸ê°T/¨Ï¥ÎªÌ¸ê°T
« ©ó: 2005-06-08, 21:20:24 »

1. Excel ª©¥»(¥N¸¹)
Application.Version

2. Windows ª©¥»
Application.OperatingSystem

3. ³Ñ¾l¥i¥Îªº°O¾ÐÅé
Application.MemoryFree (³æ¦ì¬°bytes)

¥t¥~ Application ¦³Ãö°O¾ÐÅ骺ÄݩʴN¬O
MemoryUsed ©M MemoryTotal¡A¥i¦Û¦æÀ³¥Î¡C

4. Åã¥Ü¾¹ªº¿Ã¹õ¸ÑªR«×
'32-bit API declaration
Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
Public Const SM_CXSCREEN = 0
Public Const SM_CYSCREEN = 1
Sub ScreenResolution()
¡@ VidWidth = GetSystemMetrics(SM_CXSCREEN)
¡@ VidHeight = GetSystemMetrics(SM_CYSCREEN)
¡@ MsgBox "¾³~ ¥Ø«e¿Ã¹õ¸ÑªR«×¬O: " & VidWidth & " X " & VidHeight
End Sub



¥H¤U¨Ó¦Û John Walkenbach
For Excel tips, macros, & downloads...
http://j-walk.com/ss

1. ¨ú±o¹q¸£¦WºÙ

Private Declare Function w32_GetComputerName Lib "kernel32" _
 Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Public Function GetComputerName()
¡@ Dim sComputerName As String
¡@ Dim lComputerNameLen As Long
¡@ Dim lResult As Long
¡@ lComputerNameLen = 256
¡@ sComputerName = Space(lComputerNameLen)
¡@ lResult = w32_GetComputerName(sComputerName, lComputerNameLen)
¡@ If lResult <> 0 Then
¡@¡@¡@ GetComputerName = Left(sComputerName, lComputerNameLen)
¡@ Else
¡@¡@¡@ GetComputerName = "Unknown"
¡@ End If
End Function

2. ¨ú±o¹q¸£¥Ø«eµn¤J¨Ï¥ÎªÌ¦WºÙ

Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" _
¡@(ByVal lpBuffer As String, nSize As Long) As Long

Function UserName() As String
¡@¡@Dim Buffer As String * 100
¡@¡@Dim BuffLen As Long
¡@¡@BuffLen = 100
¡@¡@GetUserName Buffer, BuffLen
¡@¡@UserName = Left(Buffer, BuffLen - 1)
End Function

¸É¥R¡G
¨ä¹ê¦³¨Ç¨t²Î/¨Ï¥ÎªÌ¸ê°T¥i¥H¥ÑÀô¹ÒÅܼƨú±o¡C
°Ñ¦Ò ¥Î Environ ¨ú±oÀô¹ÒÅܼÆ~ ¤£¬O«D­nAPI °Õ
¤w°O¿ý

leonchou
½×¾ÂºûÅ@¸s
*
Â÷½u Â÷½u

¤å³¹: 1160


¨ú±o¥»¾÷¸ê°T¸É¥R - Environ / WshNetwork
« ¦^ÂФ峹 #1 ©ó: 2005-09-23, 00:49:13 »

Environ ¤è¦¡¦C¥Ü¦p¤U¡A¥H¨D§¹¾ã¡G

Sub client_info()

MsgBox "¨Ï¥ÎªÌºô°ì" & vbTab & "= " & Environ("UserDomain") & vbLf & _
¡@¡@¡@ "¨Ï¥ÎªÌ©m¦W" & vbTab & "= " & Environ("UserName") & vbLf & _
¡@¡@¡@ "¹q¸£¦WºÙ¡@" & vbTab & "= " & Environ("ComputerName")

'PS. Win 9x ¤£¾A¥Î

End Sub

¥t¦³ WshNetwork ¤è¦¡¡G
Sub client_info()
Dim wsh As Object
Set wsh = CreateObject("WScript.Network")
MsgBox "¨Ï¥ÎªÌºô°ì" & vbTab & "= " & wsh.UserDomain & vbLf & _
¡@¡@¡@¡@¡@"¨Ï¥ÎªÌ©m¦W" & vbTab & "= " & wsh.UserName & vbLf & _
¡@¡@¡@¡@¡@"¹q¸£¦WºÙ¡@" & vbTab & "= " & wsh.ComputerName
Set wsh = Nothing

End Sub

¥D­nÀu¯ÊÂI¤ñ¸û --
¨Ï¥Î Environ ªºÀuÂI¬O¤è«K¡A¯ÊÂI«h¬O Win9x ¤£¾A¥Î¡F
©Ò¥H­n¥Î­þ¤@ºØ¼gªk´N¬Ý¦U¤H»Ý¨D©M³ß¦n¤F¡C
¤w°O¿ý

leonchou
½×¾ÂºûÅ@¸s
*
Â÷½u Â÷½u

¤å³¹: 1160


§Q¥ÎWMI ª«¥ó¨ú±o¨t²Î¸ê°T
« ¦^ÂФ峹 #2 ©ó: 2005-09-23, 01:01:19 »

WMI (Windows Management Instrumentation) §Þ³N¬O·L³n´£¨ÑªºWindows¨t²ÎºÞ²z¤u¨ã¡C³z¹L¦¹¤u¨ã¥i¦b¥»¦a©ÎºÞ²z¥Î¤áºÝ¨t²Î¤¤¨ú±o´X¥G¤@¤Áªº¸ê°T¡C«Ü¦h±M·~ªººô¸ôºÞ²z¤u¨ã³£¬O°ò©óWMI¶}µoªº¡CWMI¦bWin2000/NT¤U¬O¼Ð·Ç¤u¨ã¡A¦bWin9x¤U¬O¿ï¾Ü©Ê¦w¸Ë¿ï¶µ¡C

¥ý¨Ó¬Ý¤@­Ó§Q¥ÎWMI¨ú±o¨t²Î¸ê°TªºÂ²³æ½d¨Ò¡A³o­Ó½d¨Ò³z¹LWMIª«¥óÀò±o¨t²Î¤¤¹B¦æªºªº¶iµ{¡G

Sub wmi_client_info()
Dim system, itm
Dim i As Integer

i = 1
Set system = GetObject("winmgmts:").InstancesOf("Win32_ComputerSystem")
For Each itm In system
¡@¡@Cells(1, i) = "¹q¸£¦WºÙ: " & itm.Name
¡@¡@Cells(2, i) = "ª¬ºA: " & itm.Status
¡@¡@Cells(3, i) = "Ãþ«¬: " & itm.SystemType
¡@¡@Cells(4, i) = "¥Í²£¼t®a: " & itm.Manufacturer
¡@¡@Cells(5, i) = "«¬¸¹: " & itm.Model
¡@¡@Cells(6, i) = "°O¾ÐÅé: ~" & itm.totalPhysicalMemory \ 1024000 & "mb"
¡@¡@Cells(7, i) = "°ì(¤u§@¸s²Õ): " & itm.domain
¡@¡@'Cells(7, i) = "¤u§@²Õ" & itm.Workgroup '¤£¤ä´©WorkgroupÄÝ©Ê
¡@¡@Cells(8, i) = "·í«e¥Î¤á: " & itm.UserName
¡@¡@Cells(9, i) = "±Ò°Êª¬ºA: " & itm.BootupState
¡@¡@Cells(10, i) = "¹q¸£ÄÝ©ó: " & itm.PrimaryOwnerName
¡@¡@Cells(11, i) = "¨t²ÎÃþ«¬: " & itm.CreationClassName
¡@¡@Cells(12, i) = "¹q¸£Ãþ«¬: " & itm.Description
¡@¡@'³oùذ²³]¦w¸Ë¤F¨â­Ó§@·~¨t²Î
¡@¡@Cells(13, i) = "±Ò°Ê¿ï¶µ1 :" & itm.SystemStartupOptions(0)
¡@¡@Cells(14, i) = "±Ò°Ê¿ï¶µ2 :" & itm.SystemStartupOptions(1)
¡@¡@i = i + 1
Next

End Sub
¤w°O¿ý

leonchou
½×¾ÂºûÅ@¸s
*
Â÷½u Â÷½u

¤å³¹: 1160


§Q¥ÎWMI ª«¥ó¨ú±oºô¸ô¥d¸ê°T
« ¦^ÂФ峹 #3 ©ó: 2005-09-23, 01:14:20 »

²{¦bªº¹q¸£¥H¤Îºô¸ô²Õ¦¨¤Q¤À½ÆÂø¡C¨Ò¦p¨t²ÎµwÅé¤è­±´N¦³¥DªO¡BµwºÐ¡Bºô¥d... µ¥µ¥²Õ¥ó¡C

³nÅé¤è­±¦³§@·~¨t²Î¡B¨t²Î¤¤¦w¸Ëªº³nÅé¡B¥¿¦b¹B¦æªº¶iµ{µ¥µ¥¡Cºô¸ô¤è­±¦³°ì¡B¤u§@¸s²Õµ¥µ¥¡C§Q¥ÎWMI¥i¥H¨ú±o¤W­±ªº¥þ³¡¸ê°T¡A¦ý¬O¦pªG¹³¤W­±¤@¼Ë§Q¥Î¤À¶µ¨Ó¨ú±oªº¸Ü·|«Ü³Â·Ð¡C¦]¦¹¡AWMI´£¨Ñ¤F¤@ºØÃþ¦üSQL»y¥yªº¬d¸ß»y¥y¡A¥i¥HÂǦ¹Àò±oWMIª«¥ó¤Uªº¤l¶µ¡C

¤U­±½d¨Ò¬O·j¯Á¨t²Î¤¤¦w¸Ëªººô¥d¨Ãªð¦^ºô¥d IP ¤Î MAC ¦ì§}¡G

¨ú±o¥»¾÷ºô¥d IP ¦ì§} --

Sub Get_IP()
Dim objWMI As Object
Dim colIP As Object
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
End Sub

¨ú±o¥»¾÷ºô¥d MAC Address (¹êÅé¦ì§}) --

Sub Get_Mac_Addr()
Dim objWMI As Object
Dim colItems As Object
strComputer = "."
Set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMI.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration", _
¡@¡@"WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly)

For Each objItem In colItems
¡@MsgBox "MAC Address: " & objItem.MACAddress
Next

End Sub
¤w°O¿ý

jerrystone
¤p¾Ç¥Í
*
Â÷½u Â÷½u

¤å³¹: 1


Re: ¨ú±o¨t²Î¸ê°T/¨Ï¥ÎªÌ¸ê°T
« ¦^ÂФ峹 #4 ©ó: 2008-05-29, 12:35:32 »

³o½g¤å³¹¯uªº¶W´Îªº¡A¦ý½Ð°Ý¤@¤U¦bWMI¨ú±o¨t²Î¸ê°TªºÂ²³æ½d¨Ò¨º¤@½g¤å³¹¡A§Ú±Nµ{¦¡co¨ìvb©³¤U¥hrun¡A¦bCellsªº¦a¤è¥¦·|¥X²{"¨S¦³©w¸q³o­Ósub©Îfunction"¡A½Ð°Ý§Ú¸Ó¦p¦ó¸Ñ¨M©O¡HÁÂÁÂ!!!
¤w°O¿ý
d8726228
¤¤¾Ç¥Í
*
Â÷½u Â÷½u

¤å³¹: 11


Re: ¨ú±o¨t²Î¸ê°T/¨Ï¥ÎªÌ¸ê°T
« ¦^ÂФ峹 #5 ©ó: 2008-06-02, 13:59:52 »

¹ê§@¨âºØ§ì¨ú¹q¸£¦WºÙªº¤èªk¬Ò¦¨¥\

¤Q¤À·PÁ¼ӥD´£¨Ñ³o¨Ç¶W¹ê¥Î¸ê°T Grin
¤w°O¿ý
­¶: [1] ¦V¤W ¦C¦L 
« ¤W¤@½g¥DÃD ¤U¤@½g¥DÃD »
¸õ¨ì:  


¥»­¶ªá¤F 0.144 ¬í, ¥H¤Î 20 ¦¸ªº¸ê®Æ®w¬d¸ß.