다음을 통해 공유


ProcessStartInfo.Environment 속성

정의

이 프로세스 및 해당 자식 프로세스에 적용되는 환경 변수를 가져옵니다.

public:
 property System::Collections::Generic::IDictionary<System::String ^, System::String ^> ^ Environment { System::Collections::Generic::IDictionary<System::String ^, System::String ^> ^ get(); };
public System.Collections.Generic.IDictionary<string,string?> Environment { get; }
public System.Collections.Generic.IDictionary<string,string> Environment { get; }
member this.Environment : System.Collections.Generic.IDictionary<string, string>
Public ReadOnly Property Environment As IDictionary(Of String, String)

속성 값

이 프로세스 및 해당 자식 프로세스에 적용되는 환경 변수를 포함하는 제네릭 사전입니다.

설명

환경 변수에는 파일에 대한 검색 경로, 임시 파일의 디렉터리, 애플리케이션별 옵션 및 기타 유사한 정보가 포함됩니다. 속성을 직접 설정할 수는 없지만 속성에서 Environment 반환된 제네릭 사전을 수정할 수 있습니다. 예를 들어 다음 코드는 TempPath 환경 변수 myProcess.StartInfo.Environment.Add("TempPath", "C:\\Temp")를 추가합니다. 속성을 변경 EnvironmentUseShellExecute 후 프로세스를 시작하도록 false 속성을 설정해야 합니다. 이 true경우 UseShellExecute 메서드가 InvalidOperationException 호출되면 throw Start 됩니다.

.NET Framework 애플리케이션에서 속성을 사용하는 Environment 것은 속성을 사용하는 EnvironmentVariables 것과 동일합니다.

적용 대상

추가 정보