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 declarationDeclare 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/ss1. ¨ú±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«DnAPI °Õ