Check OS Version

usvpn

Freshman
Joined
Apr 19, 2010
Messages
45
Howdy,
I want my application to run only on Win7:
Code:
Dim MyVersion As Version = Environment.OSVersion.Version
Dim SevenVersion As New Version(6, 1, 0, 0)
If Not Version.op_GreaterThanOrEqual(MyVersion, SevenVersion) Then End
Above code will allow to run on 7 or later, how to change the condition to run only on 7?
Thanks.
 
You could always use the .CompareTo method of a version object - if you use it to compare two versions and it returns 0 then they are the same.

Out of interest is there a reason why you only want it to run on Windows 7 and not later versions?
 
You could always use the .CompareTo method of a version object - if you use it to compare two versions and it returns 0 then they are the same.

Out of interest is there a reason why you only want it to run on Windows 7 and not later versions?
 
Back
Top