Process クラス

定義

ローカル プロセスやリモート プロセスへのアクセスを提供し、ローカル システム プロセスの起動と停止ができるようにします。

public ref class Process : System::ComponentModel::Component, IDisposable
public ref class Process : IDisposable
public ref class Process : System::ComponentModel::Component
public class Process : System.ComponentModel.Component, IDisposable
public class Process : IDisposable
public class Process : System.ComponentModel.Component
type Process = class
    inherit Component
    interface IDisposable
type Process = class
    interface IDisposable
type Process = class
    inherit Component
Public Class Process
Inherits Component
Implements IDisposable
Public Class Process
Implements IDisposable
Public Class Process
Inherits Component
継承
継承
Process
実装

次の例では、 クラスのインスタンスを Process 使用してプロセスを開始します。

#using <System.dll>
using namespace System;
using namespace System::Diagnostics;
using namespace System::ComponentModel;

int main()
{
    Process^ myProcess = gcnew Process;

    try
    {
        myProcess->StartInfo->UseShellExecute = false;
        // You can start any process, HelloWorld is a do-nothing example.
        myProcess->StartInfo->FileName = "C:\\HelloWorld.exe";
        myProcess->StartInfo->CreateNoWindow = true;
        myProcess->Start();
        // This code assumes the process you are starting will terminate itself. 
        // Given that it is started without a window so you cannot terminate it 
        // on the desktop, it must terminate itself or you can do it programmatically
        // from this application using the Kill method.
    }
    catch ( Exception^ e ) 
    {
        Console::WriteLine( e->Message );
    }
}
using System;
using System.Diagnostics;
using System.ComponentModel;

namespace MyProcessSample
{
    class MyProcess
    {
        public static void Main()
        {
            try
            {
                using (Process myProcess = new Process())
                {
                    myProcess.StartInfo.UseShellExecute = false;
                    // You can start any process, HelloWorld is a do-nothing example.
                    myProcess.StartInfo.FileName = "C:\\HelloWorld.exe";
                    myProcess.StartInfo.CreateNoWindow = true;
                    myProcess.Start();
                    // This code assumes the process you are starting will terminate itself.
                    // Given that it is started without a window so you cannot terminate it
                    // on the desktop, it must terminate itself or you can do it programmatically
                    // from this application using the Kill method.
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
    }
}
Imports System.Diagnostics
Imports System.ComponentModel

Namespace MyProcessSample
    Class MyProcess
        Public Shared Sub Main()
            Try
                Using myProcess As New Process()

                    myProcess.StartInfo.UseShellExecute = False
                    ' You can start any process, HelloWorld is a do-nothing example.
                    myProcess.StartInfo.FileName = "C:\\HelloWorld.exe"
                    myProcess.StartInfo.CreateNoWindow = True
                    myProcess.Start()
                    ' This code assumes the process you are starting will terminate itself. 
                    ' Given that it is started without a window so you cannot terminate it 
                    ' on the desktop, it must terminate itself or you can do it programmatically
                    ' from this application using the Kill method.
                End Using
            Catch e As Exception
                Console.WriteLine((e.Message))
            End Try
        End Sub
    End Class
End Namespace

次の例では、 Process クラス自体と静的 Start メソッドを使用してプロセスを開始します。

#using <System.dll>

using namespace System;
using namespace System::Diagnostics;
using namespace System::ComponentModel;

// Opens the Internet Explorer application.
void OpenApplication(String^ myFavoritesPath)
{
    // Start Internet Explorer. Defaults to the home page.
    Process::Start("IExplore.exe");

    // Display the contents of the favorites folder in the browser.
    Process::Start(myFavoritesPath);
}

// Opens urls and .html documents using Internet Explorer.
void OpenWithArguments()
{
    // URLs are not considered documents. They can only be opened
    // by passing them as arguments.
    Process::Start("IExplore.exe", "www.northwindtraders.com");

    // Start a Web page using a browser associated with .html and .asp files.
    Process::Start("IExplore.exe", "C:\\myPath\\myFile.htm");
    Process::Start("IExplore.exe", "C:\\myPath\\myFile.asp");
}

// Uses the ProcessStartInfo class to start new processes,
// both in a minimized mode.
void OpenWithStartInfo()
{
    ProcessStartInfo^ startInfo = gcnew ProcessStartInfo("IExplore.exe");
    startInfo->WindowStyle = ProcessWindowStyle::Minimized;
    Process::Start(startInfo);
    startInfo->Arguments = "www.northwindtraders.com";
    Process::Start(startInfo);
}

int main()
{
    // Get the path that stores favorite links.
    String^ myFavoritesPath = Environment::GetFolderPath(Environment::SpecialFolder::Favorites);
    OpenApplication(myFavoritesPath);
    OpenWithArguments();
    OpenWithStartInfo();
}
using System;
using System.Diagnostics;
using System.ComponentModel;

namespace MyProcessSample
{
    class MyProcess
    {
        // Opens the Internet Explorer application.
        void OpenApplication(string myFavoritesPath)
        {
            // Start Internet Explorer. Defaults to the home page.
            Process.Start("IExplore.exe");

            // Display the contents of the favorites folder in the browser.
            Process.Start(myFavoritesPath);
        }

        // Opens urls and .html documents using Internet Explorer.
        void OpenWithArguments()
        {
            // url's are not considered documents. They can only be opened
            // by passing them as arguments.
            Process.Start("IExplore.exe", "www.northwindtraders.com");

            // Start a Web page using a browser associated with .html and .asp files.
            Process.Start("IExplore.exe", "C:\\myPath\\myFile.htm");
            Process.Start("IExplore.exe", "C:\\myPath\\myFile.asp");
        }

        // Uses the ProcessStartInfo class to start new processes,
        // both in a minimized mode.
        void OpenWithStartInfo()
        {
            ProcessStartInfo startInfo = new ProcessStartInfo("IExplore.exe");
            startInfo.WindowStyle = ProcessWindowStyle.Minimized;

            Process.Start(startInfo);

            startInfo.Arguments = "www.northwindtraders.com";

            Process.Start(startInfo);
        }

        static void Main()
        {
            // Get the path that stores favorite links.
            string myFavoritesPath =
                Environment.GetFolderPath(Environment.SpecialFolder.Favorites);

            MyProcess myProcess = new MyProcess();

            myProcess.OpenApplication(myFavoritesPath);
            myProcess.OpenWithArguments();
            myProcess.OpenWithStartInfo();
        }
    }
}
Imports System.Diagnostics
Imports System.ComponentModel

Namespace MyProcessSample
    Class MyProcess
        ' Opens the Internet Explorer application.
        Public Sub OpenApplication(myFavoritesPath As String)
            ' Start Internet Explorer. Defaults to the home page.
            Process.Start("IExplore.exe")

            ' Display the contents of the favorites folder in the browser.
            Process.Start(myFavoritesPath)
        End Sub

        ' Opens URLs and .html documents using Internet Explorer.
        Sub OpenWithArguments()
            ' URLs are not considered documents. They can only be opened
            ' by passing them as arguments.
            Process.Start("IExplore.exe", "www.northwindtraders.com")

            ' Start a Web page using a browser associated with .html and .asp files.
            Process.Start("IExplore.exe", "C:\myPath\myFile.htm")
            Process.Start("IExplore.exe", "C:\myPath\myFile.asp")
        End Sub

        ' Uses the ProcessStartInfo class to start new processes,
        ' both in a minimized mode.
        Sub OpenWithStartInfo()
            Dim startInfo As New ProcessStartInfo("IExplore.exe")
            startInfo.WindowStyle = ProcessWindowStyle.Minimized

            Process.Start(startInfo)

            startInfo.Arguments = "www.northwindtraders.com"

            Process.Start(startInfo)
        End Sub

        Shared Sub Main()
            ' Get the path that stores favorite links.
            Dim myFavoritesPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Favorites)

            Dim myProcess As New MyProcess()

            myProcess.OpenApplication(myFavoritesPath)
            myProcess.OpenWithArguments()
            myProcess.OpenWithStartInfo()
        End Sub
    End Class
End Namespace 'MyProcessSample

次の F# の例では、プロセスを runProc 開始し、すべての出力とエラー情報をキャプチャし、プロセスが実行されたミリ秒数を記録する関数を定義します。 関数 runProc には、起動するアプリケーションの名前、アプリケーションに指定する引数、および開始ディレクトリの 3 つのパラメーターがあります。

open System
open System.Diagnostics

let runProc filename args startDir : seq<string> * seq<string> = 
    let timer = Stopwatch.StartNew()
    let procStartInfo = 
        ProcessStartInfo(
            RedirectStandardOutput = true,
            RedirectStandardError = true,
            UseShellExecute = false,
            FileName = filename,
            Arguments = args
        )
    match startDir with | Some d -> procStartInfo.WorkingDirectory <- d | _ -> ()

    let outputs = System.Collections.Generic.List<string>()
    let errors = System.Collections.Generic.List<string>()
    let outputHandler f (_sender:obj) (args:DataReceivedEventArgs) = f args.Data
    use p = new Process(StartInfo = procStartInfo)
    p.OutputDataReceived.AddHandler(DataReceivedEventHandler (outputHandler outputs.Add))
    p.ErrorDataReceived.AddHandler(DataReceivedEventHandler (outputHandler errors.Add))
    let started = 
        try
            p.Start()
        with | ex ->
            ex.Data.Add("filename", filename)
            reraise()
    if not started then
        failwithf "Failed to start process %s" filename
    printfn "Started %s with pid %i" p.ProcessName p.Id
    p.BeginOutputReadLine()
    p.BeginErrorReadLine()
    p.WaitForExit()
    timer.Stop()
    printfn "Finished %s after %A milliseconds" filename timer.ElapsedMilliseconds
    let cleanOut l = l |> Seq.filter (fun o -> String.IsNullOrEmpty o |> not)
    cleanOut outputs,cleanOut errors

関数の runProc コードは 、ImaginaryDevelopment によって記述され、 Microsoft パブリック ライセンスで入手できます。

注釈

Process コンポーネントは、コンピューターで実行されているプロセスへのアクセスを提供します。 プロセスとは、簡単に言えば実行中のアプリです。 スレッドは、オペレーティング システムがプロセッサ時間を割り当てる基本単位です。 スレッドは、別のスレッドによって実行されている部分を含む、プロセスのコードの任意の部分を実行できます。

Processコンポーネントは、アプリの起動、停止、制御、および監視を行うための便利なツールです。 Processコンポーネントを使用して、実行中のプロセスの一覧を取得したり、新しいプロセスを開始したりできます。 システム プロセスにアクセスするには、Process コンポーネントを使用します。 Processコンポーネントを初期化した後は、実行中のプロセスに関する情報を取得するために使用できます。 そのような情報には、スレッドのセットや、読み込まれたモジュール (.dll と .exe ファイル)、プロセスが使用しているメモリの量などのパフォーマンス情報が含まれます。

この型は IDisposable インターフェイスを実装します。 型の使用が完了したら、直接的または間接的に型を破棄する必要があります。 直接的に型を破棄するには、try/finally ブロック内で Dispose メソッドを呼び出します。 間接的に型を破棄するには、using (C# の場合) または Using (Visual Basic 言語) などの言語構成要素を使用します。 詳細については、インターフェイスドキュメントの「IDisposable を実装するオブジェクトの使用」セクションを IDisposable 参照してください。

重要

このクラスのメソッドを信頼されていないデータを指定して呼び出すことには、セキュリティ上のリスクが伴います。 このクラスのメソッドの呼び出しは、信頼されたデータだけを指定して実行してください。 詳細については、「 すべての入力を検証する」を参照してください。

注意

32 ビット プロセスは 64 ビット プロセスのモジュールにアクセスできません。 32 ビット プロセスから 64 ビット プロセスの詳細情報を取得しようとすると、Win32Exception 例外が発生します。 一方で、64 ビット プロセスは 32 ビット プロセスのモジュールにアクセスできます。

プロセス コンポーネントは、一度にすべてのプロパティのグループに関する情報を取得します。 Process コンポーネントは、いずれかのグループの 1 つのメンバーに関する情報を取得した後は、そのグループ内の他のプロパティの値をキャッシュします。そして、Refresh メソッドを呼び出すまで、そのグループの他のメンバーに関する新しい情報を取得しません。 そのため、プロパティ値は、最後の Refresh メソッドの呼び出しよりも新しい値を保証しません。 グループの内訳はオペレーティング システムに依存します。

システムでパス変数を引用符で囲んで宣言している場合、その場所で見つかるプロセスを開始するときに、そのパスを完全修飾する必要があります。 そうしないと、システムはそのパスを見つけられません。 たとえば、c:\mypath がパスに含まれておらず、それを path = %path%;"c:\mypath"` のように引用符を使用して追加した場合、c:\mypath 内の任意のプロセスを開始するときに、それを完全修飾する必要があります。

システム プロセスは、プロセス識別子によって、システムで一意に識別されます。 多くの Windows リソースと同様に、プロセスはそれのハンドルによっても識別されますが、ハンドルはコンピューター上で一意でない場合があります。 ハンドルはリソースの識別子の総称です。 プロセス ハンドルは、オペレーティング システムによって保持され、Handle コンポーネントの Process プロパティを通じてアクセスできます。 これはプロセスが終了した場合でもアクセスできます。これにより、ExitCode (通常は、成功を示す 0 か、0 以外のエラー コードのどちらかです) や ExitTime などの、プロセスの管理情報を取得できます。 ハンドルは非常に貴重なリソースなので、ハンドル リークはメモリ リークよりも有害です。

注意

このクラスには、リンク確認要求と、すべてのメンバーに適用されるクラス レベルの継承確認要求が含まれています。 直接の呼び出し元か派生クラスのいずれかに完全信頼アクセス許可がない場合、SecurityException がスローされます。 セキュリティ要求の詳細については、「リンク確認要求」を参照してください。

.NET Core の注意事項

.NET Frameworkでは、 Process クラスは既定で、入力、出力、およびエラー ストリームにエンコード (通常はコード ページ エンコード) を使用Consoleします。 コード例では、システムのカルチャが英語 (米国) で、コード ページ 437 が Console クラスの既定のエンコードです。 ただし、.NET Core では、これらのエンコードの限定されたサブセットのみを使用できる場合があります。 その場合は、Encoding.UTF8 を既定のエンコードとして使用します。

Process オブジェクトが特定のコード ページ エンコードに依存している場合、Process のメソッドを呼び出す前に次の手順を行うと、特定のコード ページ エンコードも利用できます。

  1. CodePagesEncodingProvider.Instance プロパティから、EncodingProvider オブジェクトを取得します。

  2. EncodingProvider オブジェクトを Encoding.RegisterProvider メソッドに渡すと、エンコーディング プロバイダーでサポートされているその他のエンコードを利用できるようになります。

Process のメソッドを呼び出す前にエンコーディング プロバイダーを登録していれば、Process クラスは、UTF8 ではなく既定のシステム エンコードを自動的に使用します。

コンストラクター

Process()

Process クラスの新しいインスタンスを初期化します。

プロパティ

BasePriority

関連付けられたプロセスの基本優先順位を取得します。

CanRaiseEvents

コンポーネントがイベントを発生させることがきるかどうかを示す値を取得します。

(継承元 Component)
Container

IContainer を含む Component を取得します。

(継承元 Component)
DesignMode

Component が現在デザイン モードかどうかを示す値を取得します。

(継承元 Component)
EnableRaisingEvents

プロセスが終了したときに、Exited イベントを発生させるかどうかを取得または設定します。

Events

Component に結び付けられているイベント ハンドラーのリストを取得します。

(継承元 Component)
ExitCode

関連付けられたプロセスが終了したときにプロセスによって指定された値を取得します。

ExitTime

関連付けられたプロセスが終了した時刻を取得します。

Handle

関連付けられたプロセスのネイティブ ハンドルを取得します。

HandleCount

プロセスが開いたハンドルの数を取得します。

HasExited

関連付けられているプロセスが終了したかどうかを示す値を取得します。

Id

関連付けられたプロセスの一意の識別子を取得します。

MachineName

関連付けられたプロセスを実行しているコンピューターの名前を取得します。

MainModule

関連付けられたプロセスのメイン モジュールを取得します。

MainWindowHandle

関連付けられたプロセスのメイン ウィンドウで使用するウィンドウ ハンドルを取得します。

MainWindowTitle

プロセスのメイン ウィンドウのキャプションを取得します。

MaxWorkingSet

関連付けられたプロセスに許可されるワーキング セットの最大サイズ (バイト単位) を取得または設定します。

MinWorkingSet

関連付けられたプロセスに許可されるワーキング セットの最小サイズ (バイト単位) を取得または設定します。

Modules

関連付けられたプロセスに読み込まれたモジュールを取得します。

NonpagedSystemMemorySize
古い.
古い.
古い.

関連付けられたプロセスに割り当てられたページングされないシステム メモリの量 (バイト単位) を取得します。

NonpagedSystemMemorySize64

関連付けられたプロセスに割り当てられたページングされないシステム メモリの量 (バイト単位) を取得します。

PagedMemorySize
古い.
古い.
古い.

関連付けられたプロセスに割り当てられたページ メモリの量 (バイト単位) を取得します。

PagedMemorySize64

関連付けられたプロセスに割り当てられたページ メモリの量 (バイト単位) を取得します。

PagedSystemMemorySize
古い.
古い.
古い.

関連付けられたプロセスに割り当てられたページング可能なシステム メモリの量 (バイト単位) を取得します。

PagedSystemMemorySize64

関連付けられたプロセスに割り当てられたページング可能なシステム メモリの量 (バイト単位) を取得します。

PeakPagedMemorySize
古い.
古い.
古い.

関連付けられたプロセスによって使用される、仮想メモリ ページング ファイル内のメモリの最大量を取得します (バイト単位)。

PeakPagedMemorySize64

関連付けられたプロセスによって使用される、仮想メモリ ページング ファイル内のメモリの最大量を取得します (バイト単位)。

PeakVirtualMemorySize
古い.
古い.
古い.

関連付けられたプロセスによって使用される仮想メモリの最大量を取得します (バイト単位)。

PeakVirtualMemorySize64

関連付けられたプロセスによって使用される仮想メモリの最大量を取得します (バイト単位)。

PeakWorkingSet
古い.
古い.
古い.

関連付けられたプロセスのピーク ワーキング セット サイズをバイト単位で取得します。

PeakWorkingSet64

関連付けられたプロセスによって使用される物理メモリの最大量をバイト数として取得します。

PriorityBoostEnabled

メイン ウィンドウのフォーカス時に、オペレーティング システムによって関連付けられたプロセスの優先順位を一時的に上げるかどうかを示す値を取得または設定します。

PriorityClass

関連付けられたプロセスの全体的な優先順位カテゴリを取得または設定します。

PrivateMemorySize
古い.
古い.
古い.

関連付けられたプロセスに割り当てられたプライベート メモリの量 (バイト単位) を取得します。

PrivateMemorySize64

関連付けられたプロセスに割り当てられたプライベート メモリの量 (バイト単位) を取得します。

PrivilegedProcessorTime

このプロセスの特権プロセッサ時間を取得します。

ProcessName

プロセスの名前を取得します。

ProcessorAffinity

このプロセスでのスレッドの実行をスケジュールできるプロセッサを取得または設定します。

Responding

プロセスのユーザー インターフェイスが応答するかどうかを示す値を取得します。

SafeHandle

このプロセスへのネイティブ ハンドルを取得します。

SessionId

関連付けられたプロセスのターミナル サービス セッション識別子を取得します。

Site

ComponentISite を取得または設定します。

(継承元 Component)
StandardError

アプリケーションのエラー出力の読み取りに使用されるストリームを取得します。

StandardInput

アプリケーションの入力の書き込みに使用されるストリームを取得します。

StandardOutput

アプリケーションのテキスト出力の読み取りに使用されるストリームを取得します。

StartInfo

ProcessStart() メソッドに渡すプロパティを取得または設定します。

StartTime

関連付けられたプロセスが起動された時刻を取得します。

SynchronizingObject

プロセス終了イベントの結果として発行されるイベント ハンドラー呼び出しをマーシャリングするために使用するオブジェクトを取得または設定します。

Threads

関連付けられたプロセスで実行されているスレッドのセットを取得します。

TotalProcessorTime

このプロセスの合計プロセッサ時間を取得します。

UserProcessorTime

このプロセスのユーザー プロセッサ時間を取得します。

VirtualMemorySize
古い.
古い.
古い.

プロセスの仮想メモリのサイズ (バイト単位) を取得します。

VirtualMemorySize64

関連付けられたプロセスに割り当てられた仮想メモリの量 (バイト単位) を取得します。

WorkingSet
古い.
古い.
古い.

関連付けられたプロセスの物理メモリ使用量 (バイト単位) を取得します。

WorkingSet64

関連付けられたプロセスに割り当てられた物理メモリの量 (バイト単位) を取得します。

メソッド

BeginErrorReadLine()

アプリケーションのリダイレクトされた StandardError ストリームで、非同期読み取り操作を開始します。

BeginOutputReadLine()

アプリケーションのリダイレクトされた StandardOutput ストリームで、非同期読み取り操作を開始します。

CancelErrorRead()

アプリケーションのリダイレクトされた StandardError ストリームで、非同期読み取り操作をキャンセルします。

CancelOutputRead()

アプリケーションのリダイレクトされた StandardOutput ストリームで、非同期読み取り操作をキャンセルします。

Close()

このコンポーネントに関連付けられているすべてのリソースを解放します。

CloseMainWindow()

メイン ウィンドウにクローズ メッセージを送信して、ユーザー インターフェイスがあるプロセスを終了します。

CreateObjRef(Type)

リモート オブジェクトとの通信に使用するプロキシの生成に必要な情報をすべて格納しているオブジェクトを作成します。

(継承元 MarshalByRefObject)
Dispose()

アンマネージ リソースの解放またはリセットに関連付けられているアプリケーション定義のタスクを実行します。

Dispose()

Component によって使用されているすべてのリソースを解放します。

(継承元 Component)
Dispose(Boolean)

このプロセスによって使用されているすべてのリソースを解放します。

EnterDebugMode()

現在のスレッドのネイティブ プロパティ SeDebugPrivilege を有効にすることにより、Process コンポーネントを、特殊なモードで実行されているオペレーティング システム プロセスと対話する状態にします。

Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetCurrentProcess()

新しい Process コンポーネントを取得し、現在アクティブなプロセスに関連付けます。

GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetLifetimeService()
古い.

対象のインスタンスの有効期間ポリシーを制御する、現在の有効期間サービス オブジェクトを取得します。

(継承元 MarshalByRefObject)
GetProcessById(Int32)

ローカル コンピューター上のプロセス ID が指定された新しい Process コンポーネントを返します。

GetProcessById(Int32, String)

プロセス ID とネットワーク上のコンピューターの名前が指定された新しい Process コンポーネントを返します。

GetProcesses()

ローカル コンピューター上の各プロセス リソースごとに新しい Process コンポーネントを作成します。

GetProcesses(String)

指定したコンピューター上の各プロセス リソースごとに新しい Process コンポーネントを作成します。

GetProcessesByName(String)

新しい Process コンポーネントの配列を作成し、指定したプロセス名を共有するローカル コンピューター上のすべてのプロセス リソースに関連付けます。

GetProcessesByName(String, String)

新しい Process コンポーネントの配列を作成し、指定したプロセス名を共有するリモート コンピューター上のすべてのプロセス リソースに関連付けます。

GetService(Type)

Component またはその Container で提供されるサービスを表すオブジェクトを返します。

(継承元 Component)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
InitializeLifetimeService()
古い.

このインスタンスの有効期間ポリシーを制御する有効期間サービス オブジェクトを取得します。

(継承元 MarshalByRefObject)
Kill()

関連付けられたプロセスを即時中断します。

Kill(Boolean)

関連付けられているプロセスと、任意で、その子/子孫プロセスを直ちに停止します。

LeaveDebugMode()

Process コンポーネントを、特殊なモードで実行されているオペレーティング システム プロセスと対話する状態から解放します。

MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
MemberwiseClone(Boolean)

現在の MarshalByRefObject オブジェクトの簡易コピーを作成します。

(継承元 MarshalByRefObject)
OnExited()

Exited イベントを発生させます。

Refresh()

プロセス コンポーネントにキャッシュされている関連付けられたプロセスに関するすべての情報を破棄します。

Start()

この Process コンポーネントの StartInfo プロパティで指定されたプロセス リソースを起動 (または再利用) し、コンポーネントに関連付けます。

Start(ProcessStartInfo)

プロセス起動情報 (起動するプロセスのファイル名など) が格納されているパラメーターで指定されたプロセス リソースを起動し、リソースを新しい Process コンポーネントに関連付けます。

Start(String)

文書またはアプリケーション ファイルの名前を指定してプロセス リソースを起動し、リソースを新しい Process コンポーネントに関連付けます。

Start(String, IEnumerable<String>)

アプリケーションの名前とコマンド ライン引数のセットを指定してプロセス リソースを起動します。

Start(String, String)

アプリケーションの名前とコマンド ライン引数のセットを指定してプロセス リソースを起動し、リソースを新しい Process コンポーネントに関連付けます。

Start(String, String, SecureString, String)

アプリケーションの名前、ユーザー名、パスワード、ドメインを指定してプロセス リソースを起動し、リソースを新しい Process コンポーネントに関連付けます。

Start(String, String, String, SecureString, String)

アプリケーションの名前、コマンド ライン引数のセット、ユーザー名、パスワード、およびドメインを指定してプロセス リソースを起動し、リソースを新しい Process コンポーネントに関連付けます。

ToString()

プロセス名の書式指定は文字列にします。親コンポーネント型があれば、この型と組み合わせます。

ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)
WaitForExit()

関連付けられたプロセスが終了するまで無期限に待機するように Process コンポーネントに指示します。

WaitForExit(Int32)

関連付けられたプロセスが終了するまで、最大で指定したミリ秒間待機するように Process コンポーネントに指示します。

WaitForExit(TimeSpan)

関連付けられたプロセスが終了するまで、指定した時間待機するように Process コンポーネントに指示します。

WaitForExitAsync(CancellationToken)

関連するプロセスが終了するか、cancellationToken が取り消されるまで待つようにプロセス コンポーネントに指示します。

WaitForInputIdle()

関連付けられたプロセスがアイドル状態になるまで、Process コンポーネントを無期限に待機させます。 このオーバーロードは、ユーザー インターフェイスとメッセージ ループを持つプロセスにだけ適用されます。

WaitForInputIdle(Int32)

関連付けられたプロセスがアイドル状態になるまで、最大で指定したミリ秒間、Process コンポーネントを待機させます。 このオーバーロードは、ユーザー インターフェイスとメッセージ ループを持つプロセスにだけ適用されます。

WaitForInputIdle(TimeSpan)

関連付けられたプロセスが Process アイドル状態になるまで、指定された timeout をコンポーネントが待機させます。 このオーバーロードは、ユーザー インターフェイスとメッセージ ループを持つプロセスにだけ適用されます。

イベント

Disposed

Dispose() メソッドの呼び出しによってコンポーネントが破棄されるときに発生します。

(継承元 Component)
ErrorDataReceived

アプリケーションがリダイレクトされた StandardError ストリームに書き込む場合に発生します。

Exited

プロセスが終了したときに発生します。

OutputDataReceived

アプリケーションが、リダイレクトされた StandardOutput ストリームに行を書き込む度に発生します。

適用対象

こちらもご覧ください