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

◆ OpenEnvironmentKeyIfExists()

static RegistryKey System.Environment.OpenEnvironmentKeyIfExists ( bool fromMachine,
bool writable )
inlinestaticprivate

Definition at line 619 of file Environment.cs.

620 {
621 RegistryKey registryKey;
622 string name;
623 if (fromMachine)
624 {
625 registryKey = Registry.LocalMachine;
626 name = "System\\CurrentControlSet\\Control\\Session Manager\\Environment";
627 }
628 else
629 {
630 registryKey = Registry.CurrentUser;
631 name = "Environment";
632 }
633 return registryKey.OpenSubKey(name, writable);
634 }
RegistryKey OpenSubKey(string name)
static readonly RegistryKey LocalMachine
Definition Registry.cs:9
static readonly RegistryKey CurrentUser
Definition Registry.cs:7

References Internal.Win32.Registry.CurrentUser, Internal.Win32.Registry.LocalMachine, and Internal.Win32.RegistryKey.OpenSubKey().

Referenced by System.Environment.GetEnvironmentVariableFromRegistry(), System.Environment.GetEnvironmentVariablesFromRegistry(), and System.Environment.SetEnvironmentVariableFromRegistry().