以下是引用bczgvip在2012-7-8 20:29:55的发言:
Option Explicit
Private Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128 ' Maintenance string for PSS usage
End Type
Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
Private Sub Form_Load()
Dim osvi As OSVERSIONINFO
Dim bIsWindowsXPorLater As Long
osvi.dwOSVersionInfoSize = Len(osvi)
bIsWindowsXPorLater = GetVersionEx(osvi)
Debug.Print osvi.dwMajorVersion, osvi.dwMinorVersion, osvi.dwBuildNumber, osvi.dwPlatformId, osvi.szCSDVersion
End Sub
程序运行没有看到直观的输出我的系统是WINXP ,还是WIN2000 WIN7
本地立即监视窗口显示了部分信息。
最好能用Msgbox来弹出系统的类型。
图片附件: 游客没有浏览图片的权限,请
登录 或
注册