|
怎么知道我的系统是2000还是98
Private Declare Function GetVersionEx Lib "kernel32.dll" _
Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
Private Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type
Private Sub CmdGetOs_Click()
'目的: 取得 OS 信息
'作者: Ms Access
Dim os As OSVERSIONINFO
Dim retval As Long
Dim OsVer As String
os.dwOSVersionInfoSize = Len(os)
retval = GetVersionEx(os)
Select Case os.dwPlatformId
Case 0
OsVer = "Windows 3.x"
Case 1
OsVer = "Windows 95 或 98"
Case 2
OsVer = "Windows NT"
End Select
MsgBox "你的操作系统为 " & OsVer, vbInformation, "Ms Access"
End Sub
|
|