我有这个问题:
Private Function Get_NT_Version()
Dim NT As Decimal = CDec(System.Environment.OSVersion.Version.ToString.Substring(0, 3))
MsgBox(NT)
Return NT
End Function
我在 Win7 上运行,所以我想获得这个值作为十进制或双精度:“ 6.1 ”但我得到的是:“ 61 ”
这就是我想要做的:
If Get_NT_Version() < 6.0 Then
msgbox("This application only works with an Aero compatible windows version")
Application.Exit()
end if
更新:
也尝试过这个想法,但返回“61”
Dim s As Double = String.Format("{0}.{1}", System.Environment.OSVersion.Version.ToString.Split(".")(0), System.Environment.OSVersion.Version.ToString.Split(".")(1))