请参阅
原文链接:https://www.f2er.com/vb/255002.htmlEnvironment.OSVersion
property on MSDN.它是一个返回
OperatingSystem
对象的静态属性,该对象具有
Version
属性,您只需检查主要版本号和次要版本号以查看它是否为6.1(
Windows 7 is actually version 6.1).
Dim osVer As Version = Environment.OSVersion.Version If osVer.Major = 6 And osVer.Minor = 1 Then Console.WriteLine("win7!!") End If