Thanks Justin.
--
William Stacey, MVP
"Justin Rogers" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> You could just use the Version as is:
>
> For example:
>
> Version targetVersion = new Version(5, 2);
> Version osVersion = Environment.OSVersion.Version;
>
> if ( osVersion < targetVersion ) {
> }
>
> Note this will be more precise and can take into account builds and revion
> numbers as well.
>
> --
> Justin Rogers
> DigiTec Web Consultants, LLC.
>
> "William Stacey" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > Is there a better way to get a double (or other) for os version then
this?
> > I want to get os version early in program,
> > then do checks like: if ( osVersion < 5.2 ) //do something. TIA
> >
> > int major = Environment.OSVersion.Version.Major;
> > int minor = Environment.OSVersion.Version.Minor;
> > try
> > {
> > double dver = Double.Parse(major.ToString() + "." + minor.ToString());
> > return dver;
> > }
> > catch
> > {
> > //Do something;
> > }
> >
> > --
> > William Stacey, MVP
> >
> >
> >
>
>
|