//*************BEGIN GENERAL TAB*********************************** //BROWSING HISTORY/CHECK FOR NEWER VERSIONS OF STORED PAGES //Select the RegistryHive you wish to read from RegistryKey key = RegistryKey.OpenRemoteBaseKey(RegistryHive.CurrentUser, ""); //Select the path within the hive Console.WriteLine(""); RegistryKey subkey1 = key.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", true); string[] names1 = subkey1.GetValueNames(); string YesSyncMode5NameExists = ""; string NoSyncMode5NameExists = ""; foreach (string name in names1) { if (name.Equals("SyncMode5", StringComparison.CurrentCulture)) { // Found SyncMode5 YesSyncMode5NameExists = "1"; //NoSyncMode5NameExists = "99"; break; } else { // No Found SyncMode5 NoSyncMode5NameExists = "1"; //subkey1.SetValue("SyncMode5", "2", RegistryValueKind.DWord); } } if (YesSyncMode5NameExists == "1") { Console.WriteLine("YES Found SyncMode5"); int myValue = (int)subkey1.GetValue("SyncMode5"); if (myValue != 2) { //Console.WriteLine("Setting the right GE Recommendation"); subkey1.SetValue("SyncMode5", "2", RegistryValueKind.DWord); } } if (NoSyncMode5NameExists == "1") { //Console.WriteLine("NO Found SyncMode5, creating it "); //Console.WriteLine("Setting the right GE Recommendation"); subkey1.SetValue("SyncMode5", "2", RegistryValueKind.DWord); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)