Пример #1
0
 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);
     }
 }
Пример #2
0
        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));
        }
Пример #3
0
        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));
        }
Пример #4
0
        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));
        }
Пример #5
0
 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"));
 }
Пример #6
0
        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);
            }
        }
Пример #7
0
 public void KnownDeepSubKeysExist()
 {
     Assert.IsTrue(WindowsRegistryStuff.KeyHasSubkey("currentconfig", @"System\CurrentControlSet\SERVICES\TSDDD"));
 }
Пример #8
0
 public void KnownCurrentConfigKeysExist()
 {
     Assert.IsTrue(WindowsRegistryStuff.KeyHasSubkey("currentconfig", "Software"));
 }
Пример #9
0
 public void KnownUsersKeysExist()
 {
     Assert.IsTrue(WindowsRegistryStuff.KeyHasSubkey("users", ".DEFAULT"));
 }
Пример #10
0
 public void KnownLocalMachineKeysExist()
 {
     Assert.IsTrue(WindowsRegistryStuff.KeyHasSubkey("localmachine", "HARDWARE"));
 }
Пример #11
0
 public void KnownCurrentUserKeysExist()
 {
     Assert.IsTrue(WindowsRegistryStuff.KeyHasSubkey("currentuser", "Console"));
 }
Пример #12
0
 public void KnownClassesRootKeysExist()
 {
     Assert.IsTrue(WindowsRegistryStuff.KeyHasSubkey("classesroot", "._sln80"));
 }