System.Environment.Environment.GetEnvironmentVariables C# (CSharp) Méthode

GetEnvironmentVariables() public static méthode

Return a set of all environment variables and their values
public static GetEnvironmentVariables ( ) : IDictionary
Résultat IDictionary
		public static IDictionary GetEnvironmentVariables ()
		{
			StringBuilder sb = null;
			if (SecurityManager.SecurityEnabled) {
				// we must have access to each variable to get the lot
				sb = new StringBuilder ();
				// but (performance-wise) we do not want a stack-walk
				// for each of them so we concatenate them
			}

			Hashtable vars = new Hashtable ();
			foreach (string name in GetEnvironmentVariableNames ()) {
				vars [name] = internalGetEnvironmentVariable (name);
				if (sb != null) {
					sb.Append (name);
					sb.Append (";");
				}
			}

			if (sb != null) {
				new EnvironmentPermission (EnvironmentPermissionAccess.Read, sb.ToString ()).Demand ();
			}
			return vars;
		}
#else

Same methods

Environment.Environment::GetEnvironmentVariables ( EnvironmentVariableTarget target ) : IDictionary