VB判断系统是否为 Vista 或更高版本系统

前端之家收集整理的这篇文章主要介绍了VB判断系统是否为 Vista 或更高版本系统前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

Option Explicit

Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OVSERSIONINFOEX) As Long

Private Type OVSERSIONINFOEX
dwOVSersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
wServicePackMajor As Integer
wServicePackMinor As Integer
wSuiteMask As Integer
wProductType As Byte
wReserved As Byte
End Type

Public Function IsVistaSystem() As Boolean Dim OVS As OVSERSIONINFOEX OVS.dwOVSersionInfoSize = Len(OVS) If GetVersionEx(OVS) = 1 Then If OVS.dwPlatformId = 2 And OVS.dwMajorVersion >= 6 And OVS.dwMinorVersion >= 0 Then IsVistaSystem = True End If End IfEnd Function

原文链接:https://www.f2er.com/vb/262413.html

猜你在找的VB相关文章