private void GetSteamData() { if (WindowsRegistryStuff.KeyHasSubkey("currentuser", @"Software\Valve\Steam")) { SteamPath = (string)WindowsRegistryStuff.RegistryGetValue("currentuser", @"Software\Valve\Steam", "SteamPath"); SteamUserName = (string)WindowsRegistryStuff.RegistryGetValue("currentuser", @"Software\Valve\Steam", "LastGameNameUsed"); if (string.IsNullOrEmpty(providedName)) { providedName = SteamUserName; } if (getSteamId)//ignore all this if an id was given { if (!(providedName.Equals(SteamUserName))) { SteamUserName = providedName; } using (SoloProjects.Dudhit.SpaceEngineers.SEBP.SteamConfigReader.FindSteamID fsID = new SoloProjects.Dudhit.SpaceEngineers.SEBP.SteamConfigReader.FindSteamID(SteamPath, SteamUserName)) { SteamUserId = fsID.SteamID; } } } else { MessageBox.Show("Windows could not return the location of your Steam installation\n manual entry required", "Unknown Steam Installation location", MessageBoxButton.OK, MessageBoxImage.Warning); } }
public void GetNonExistingKeyValue() { string expected = ""; string result = (string)WindowsRegistryStuff.RegistryGetValue("users", @".DEFAULT\Environment", "TEMPc"); Assert.AreEqual(expected, result); System.Diagnostics.Trace.WriteLine(string.Format("expected:{0} result:{1}", expected, result)); }
public void GetKnownKeyValueC() { string expected = @"res://mshtml.dll/blank.htm"; string result = (string)WindowsRegistryStuff.RegistryGetValue("localmachine", @"SOFTWARE\Microsoft\Internet Explorer\AboutURLs", "blank"); Assert.AreEqual(expected, result); System.Diagnostics.Trace.WriteLine(string.Format("expected:{0} result:{1}", expected, result)); }
public void GetKnownKeyValueB() { string expected = ""; string result = (string)WindowsRegistryStuff.RegistryGetValue("currentuser", @"Software\Mozilla\Firefox\Crash Reporter", "Email"); Assert.AreEqual(expected, result); System.Diagnostics.Trace.WriteLine(string.Format("expected:{0} result:{1}", expected, result)); }
public void KnownKeysDoNotExist() { Assert.IsFalse(WindowsRegistryStuff.KeyHasSubkey("classesroot", "._sln81110")); Assert.IsFalse(WindowsRegistryStuff.KeyHasSubkey("currentuser", "Consolee")); Assert.IsFalse(WindowsRegistryStuff.KeyHasSubkey("localmachine", "HARDWAREe")); Assert.IsFalse(WindowsRegistryStuff.KeyHasSubkey("users", ".DEFAULTe")); Assert.IsFalse(WindowsRegistryStuff.KeyHasSubkey("currentconfig", "Softwaree")); Assert.IsFalse(WindowsRegistryStuff.KeyHasSubkey("currentconfig", @"System\CurrentControlSet\SERVICES\TSDDDD")); }
public void ShowNamesInKey() { RegistryKey myTest = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Internet Explorer\AboutURL"); string[] results = WindowsRegistryStuff.ValueNamesOfKey(myTest); foreach (string s in results) { System.Diagnostics.Trace.WriteLine(s); } }
public void KnownDeepSubKeysExist() { Assert.IsTrue(WindowsRegistryStuff.KeyHasSubkey("currentconfig", @"System\CurrentControlSet\SERVICES\TSDDD")); }
public void KnownCurrentConfigKeysExist() { Assert.IsTrue(WindowsRegistryStuff.KeyHasSubkey("currentconfig", "Software")); }
public void KnownUsersKeysExist() { Assert.IsTrue(WindowsRegistryStuff.KeyHasSubkey("users", ".DEFAULT")); }
public void KnownLocalMachineKeysExist() { Assert.IsTrue(WindowsRegistryStuff.KeyHasSubkey("localmachine", "HARDWARE")); }
public void KnownCurrentUserKeysExist() { Assert.IsTrue(WindowsRegistryStuff.KeyHasSubkey("currentuser", "Console")); }
public void KnownClassesRootKeysExist() { Assert.IsTrue(WindowsRegistryStuff.KeyHasSubkey("classesroot", "._sln80")); }