Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetEnvironmentVariablesFromRegistry()

static IDictionary System.Environment.GetEnvironmentVariablesFromRegistry ( bool fromMachine)
inlinestaticprivate

Definition at line 595 of file Environment.cs.

596 {
597 Hashtable hashtable = new Hashtable();
598 using (RegistryKey registryKey = OpenEnvironmentKeyIfExists(fromMachine, writable: false))
599 {
600 if (registryKey != null)
601 {
602 string[] valueNames = registryKey.GetValueNames();
603 foreach (string text in valueNames)
604 {
605 string value = registryKey.GetValue(text, "").ToString();
606 try
607 {
608 hashtable.Add(text, value);
609 }
610 catch (ArgumentException)
611 {
612 }
613 }
614 }
615 }
616 return hashtable;
617 }
object GetValue(string name)
virtual void Add(object key, object? value)
Definition Hashtable.cs:676
static RegistryKey OpenEnvironmentKeyIfExists(bool fromMachine, bool writable)

References System.Collections.Hashtable.Add(), Internal.Win32.RegistryKey.GetValue(), Internal.Win32.RegistryKey.GetValueNames(), System.Environment.OpenEnvironmentKeyIfExists(), System.text, and System.value.

Referenced by System.Environment.GetEnvironmentVariables().