Not able to retrive Operating System Service Pack Name for 64 bit OS using C#

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi
I am not trying to retrive OS service pack name using the below c# code. code is working fine for 32 bit but it doesnot work for 64 bits OS. For 64 bits OS, the code returns "NULL" value even though it has some service pack entry
var reg = Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, word.Trim());<br/>
var key = reg.OpenSubKey(@"SoftwareMicrosoftWindows NTCurrentVersion");<br/>
string servicePack = (string)key.GetValue("CSDVersion");
i dont think is there any name space for 64 bit like "Microsoft.Win64", Any idea how do i get the service pack name for 64 bit OS?..
your help would be appreciated!.

Thanks,
Umapathy



<hr class="sig Thanks -Umapathy

View the full article
 
Back
Top