Process.Run 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
오버로드
| 속성 | Description |
|---|---|
| Run(ProcessStartInfo, Nullable<TimeSpan>) |
설명 |
| Run(String, IEnumerable<String>, Boolean, Nullable<TimeSpan>) |
지정된 파일 이름 및 선택적 인수를 사용하여 프로세스를 시작하고 종료될 때까지 기다렸다가 종료 상태를 반환합니다. |
Run(ProcessStartInfo, Nullable<TimeSpan>)
- Source:
- Process.Scenarios.cs
설명 startInfo한 프로세스를 시작하고 종료할 때까지 기다렸다가 종료 상태를 반환합니다.
[System.Runtime.Versioning.SupportedOSPlatform("maccatalyst")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
public static System.Diagnostics.ProcessExitStatus Run(System.Diagnostics.ProcessStartInfo startInfo, TimeSpan? timeout = default);
[<System.Runtime.Versioning.SupportedOSPlatform("maccatalyst")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
static member Run : System.Diagnostics.ProcessStartInfo * Nullable<TimeSpan> -> System.Diagnostics.ProcessExitStatus
Public Shared Function Run (startInfo As ProcessStartInfo, Optional timeout As Nullable(Of TimeSpan) = Nothing) As ProcessExitStatus
매개 변수
- startInfo
- ProcessStartInfo
ProcessStartInfo 프로세스를 시작하는 데 사용되는 정보가 들어 있는 항목입니다.
프로세스가 종료되기를 기다리는 최대 시간입니다. 이면 null무기한 대기합니다. 프로세스가 지정된 시간 제한 내에 종료되지 않으면 종료됩니다.
반품
프로세스의 종료 상태입니다. 시간 제한 Canceled 으로 인해 프로세스가 종료된 경우는 다음과 입니다 true.
- 특성
예외
timeout정수 밀리초로 자른 값이 -1 미만이거나 보다 MaxValue큽니다.
startInfo은 null입니다.
UseShellExecute이 true로 설정됩니다.
또는
RedirectStandardInput, RedirectStandardOutput또는 RedirectStandardError .로 설정됩니다 true. 대신 해당 표준 핸들 속성을 사용하여 핸들을 제공합니다.
적용 대상
Run(String, IEnumerable<String>, Boolean, Nullable<TimeSpan>)
- Source:
- Process.Scenarios.cs
지정된 파일 이름 및 선택적 인수를 사용하여 프로세스를 시작하고 종료될 때까지 기다렸다가 종료 상태를 반환합니다.
[System.Runtime.Versioning.SupportedOSPlatform("maccatalyst")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
public static System.Diagnostics.ProcessExitStatus Run(string fileName, System.Collections.Generic.IEnumerable<string>? arguments = default, bool silent = false, TimeSpan? timeout = default);
[<System.Runtime.Versioning.SupportedOSPlatform("maccatalyst")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
static member Run : string * seq<string> * bool * Nullable<TimeSpan> -> System.Diagnostics.ProcessExitStatus
Public Shared Function Run (fileName As String, Optional arguments As IEnumerable(Of String) = Nothing, Optional silent As Boolean = false, Optional timeout As Nullable(Of TimeSpan) = Nothing) As ProcessExitStatus
매개 변수
- fileName
- String
시작할 실행 파일의 이름입니다.
- arguments
- IEnumerable<String>
프로세스에 전달할 명령줄 인수입니다. 추가 인수 없이 프로세스를 시작하는 빈 시퀀스를 전달하거나 빈 시퀀스를 전달 null 합니다.
- silent
- Boolean
표준 true입력, 출력 및 오류를 null 디바이스로 리디렉션하면 프로세스가 표시되는 콘솔 출력을 생성하지 않습니다. 이 경우 false프로세스는 부모로부터 표준 핸들을 상속합니다.
프로세스가 종료되기를 기다리는 최대 시간입니다. 이면 null무기한 대기합니다. 프로세스가 지정된 시간 제한 내에 종료되지 않으면 종료됩니다.
반품
프로세스의 종료 상태입니다. 시간 제한 Canceled 으로 인해 프로세스가 종료된 경우는 다음과 입니다 true.
- 특성
예외
timeout정수 밀리초로 자른 값이 -1 미만이거나 보다 MaxValue큽니다.
fileName은 null입니다.
fileName 가 비어 있습니다.