直接提供Winform程序
OperatingSystem os = EnvironmentOSVersion;
switch (osPlatform)
{
case PlatformIDWinWindows:
switch (osVersionMinor)
{
case :
labelText = "Windows ";
break;
case :
if (osVersionRevisionToString() == "A ")
labelText = "Windows 第二版 ";
else
labelText = "Windows ";
break;
case :
labelText = "Windows Me ";
break;
}
break;
case PlatformIDWinNT:
switch (osVersionMajor)
{
case :
labelText = "Windows NT ";
break;
case :
labelText = "Windows NT ";
break;
case :
switch (osVersionMinor)
{
case :
labelText = "Windows ";
break;
case :
labelText = "Windows XP ";
break;
case :
labelText = "Windows ";
break;
}
break;
case :
switch (osVersionMinor)
{
case :
labelText = "Windows Vista ";
break;
case :
labelText = "Windows ";
break;
}
break;
}
break;
}
当然大家直接可以通过 OperatingSystem os = EnvironmentOSVersion;然后判断osVersionMajor是否是等于就可以判断系统是不是windows Vista以上版本