![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum for Windows Vista help and discussion. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | How do I distinguish between 32 & 64-bit vista? Vista 32 & 64 both report the same OS version. Existing code that worked for previous Microsoft OS: // Get the version information Version vs = os.Version; PlatformID p = os.Platform; case System.PlatformID.Win32NT: switch(vs.Major) { case 5: if (vs.Minor == 0) return "Windows 2000 " + os.Version.ToString(); else if (vs.Minor == 1) return "Windows XP " + os.Version.ToString(); else if (vs.Minor == 2) return "Windows XP 64 " + os.Version.ToString(); else return "Unknown Windows NT: " + os.Version.ToString(); case 6: if (vs.Minor == 0) return "Windows Vista " + os.Version.ToString(); else return "Windows Vista 64 " + os.Version.ToString(); // assumption for now default: return ("Win32NT family:" + vs.Major.ToString() + "." + vs.Minor.ToString() + " ->" + os.VersionString); Vista 32 & 64 both report the same version. |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: How do I distinguish between 32 & 64-bit vista? Would this work? Console.WriteLine("This is a {0}-bit OS.", IntPtr.Size * 8); Bryan Phillips MCSD, MCDBA, MCSE Blog: http://bphillips76.spaces.live.com "John Elliott" <JohnElliott@discussions.microsoft.com> wrote in message news:3A536541-269B-432E-B591-75B2D9DEE891@microsoft.com: > Vista 32 & 64 both report the same OS version. > > Existing code that worked for previous Microsoft OS: > // Get the version information > Version vs = os.Version; > PlatformID p = os.Platform; > case System.PlatformID.Win32NT: > switch(vs.Major) > { > case 5: > if (vs.Minor == 0) > return "Windows 2000 " + os.Version.ToString(); > else if (vs.Minor == 1) > return "Windows XP " + os.Version.ToString(); > else if (vs.Minor == 2) > return "Windows XP 64 " + os.Version.ToString(); > else > return "Unknown Windows NT: " + os.Version.ToString(); > case 6: > if (vs.Minor == 0) > return "Windows Vista " + os.Version.ToString(); > else > return "Windows Vista 64 " + os.Version.ToString(); > // assumption for now > default: > return ("Win32NT family:" + vs.Major.ToString() + "." + > vs.Minor.ToString() + " ->" + os.VersionString); > > Vista 32 & 64 both report the same version. |
My System Specs![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: How to distinguish one PowerShell from another. | RickB | PowerShell | 1 | 07-29-2008 10:07 AM |
| How to distinguish one PowerShell from another. | RickB | PowerShell | 3 | 07-25-2008 08:55 AM |
| Complimentary Industry Resources Vista Forums has joined forces with TradePub.com to offer you a new, exciting, and entirely free professional resource. Visit http://vistax64.tradepub.com today to browse our selection of complimentary Industry magazines, white papers, webinars, podcasts, and more across 34 industry sectors. No credit cards, coupons, or promo codes required. Try it today! |