how to get user's operating system?

  • Thread starter Thread starter Lloyd Dupont
  • Start date Start date
L

Lloyd Dupont

I tried
Environment.OSVersion.Version
but it tells me I'm running Windows NT 5.1.2600 while I'm running Windows XP
Pro....
Any tip?
 
Well I think I will go with the code sample below , if no-one could advise me of a better solution:
static string FriendlyOSName(OperatingSystem osinfo)
{
if (osinfo.Platform == PlatformID.Win32NT)
{
if (osinfo.Version.Minor == 4)
return "Microsoft Windows NT";
if (osinfo.Version.Major == 5 && osinfo.Version.Minor == 0)
return "Microsoft Windows 2000";
if (osinfo.Version.Major == 5 && osinfo.Version.Minor == 1)
return "Microsoft Windows XP";
}
return osinfo.ToString();
}
 
Back
Top