How to check the Registery keys.

Ask general questions here.
sunitha
Posts: 24
Joined: Thu May 14, 2009 2:06 pm

How to check the Registery keys.

Post by sunitha » Fri May 29, 2009 1:10 pm

My Install.exe installs the product and writes some values in the Registry .
I need to check if the Registry values exists or not.
Can you let me know if any function or method exists in Ranorex to capture this??
:)

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Post by Ciege » Fri May 29, 2009 4:19 pm

This following code will read the value from WarnOnIntranet in the HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings path.

Code: Select all

RegistryKey CurrentUserRegKey;
CurrentUserRegKey = Registry.CurrentUser.CreateSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings");
intKeyValue = (int)CurrentUserRegKey.GetValue("WarnOnIntranet", 1);
This is within Visual Studio using C#.