Process.ExitTime プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Process.ExitTime プロパティの意味・解説 

Process.ExitTime プロパティ

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

名前空間: System.Diagnostics
アセンブリ: System (system.dll 内)
構文構文

例外例外
例外種類条件

PlatformNotSupportedException

プラットフォームWindows 98 または Windows Millennium Edition (Windows Me) です。このプロパティサポートされません。

解説解説
使用例使用例

ファイル出力するプロセス作成するコード例次に示しますプロセス終了時Exited イベント発生しイベント ハンドラExitTime プロパティおよび他のプロセス情報表示します

Imports System
Imports System.Diagnostics
Imports System.ComponentModel
Imports System.Threading
Imports Microsoft.VisualBasic

Class PrintProcessClass

    Private WithEvents myProcess As
 New Process
    Private elapsedTime As Integer
    Private eventHandled As Boolean

    ' Print a file with any known extension.
    Sub PrintDoc(ByVal fileName As
 String)

        elapsedTime = 0
        eventHandled = False

        Try
            ' Start a process to print a file and raise an event when
 done.
            myProcess.StartInfo.FileName = fileName
            myProcess.StartInfo.Verb = "Print"
            myProcess.StartInfo.CreateNoWindow = True
            myProcess.EnableRaisingEvents = True
            myProcess.Start()

        Catch ex As Exception
            Console.WriteLine("An error occurred trying to print
 ""{0}"":"
 & _
                vbCrLf & ex.Message, fileName)
            Return
        End Try

        ' Wait for Exited event, but not more than 30 seconds.
        Const SLEEP_AMOUNT As Integer
 = 100
        Do While Not eventHandled
            elapsedTime += SLEEP_AMOUNT
            If elapsedTime > 30000 Then
                Exit Do
            End If
            Thread.Sleep(SLEEP_AMOUNT)
        Loop
    End Sub

    ' Handle Exited event and display process information.
    Private Sub myProcess_Exited(ByVal
 sender As Object, _
            ByVal e As System.EventArgs) Handles
 myProcess.Exited

        eventHandled = True
        Console.WriteLine("Exit time:    {0}" &
 vbCrLf & _
            "Exit code:    {1}" & vbCrLf &
 "Elapsed time: {2}", _
            myProcess.ExitTime, myProcess.ExitCode, elapsedTime)
    End Sub

    Shared Sub Main(ByVal
 args() As String)

        ' Verify that an argument has been entered.
        If args.Length <= 0 Then
            Console.WriteLine("Enter a file name.")
            Return
        End If

        ' Create the process and print the document.
        Dim myProcess As New
 PrintProcessClass
        myProcess.PrintDoc(args(0))
    End Sub
End Class
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からProcess.ExitTime プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からProcess.ExitTime プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からProcess.ExitTime プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「Process.ExitTime プロパティ」の関連用語

Process.ExitTime プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Process.ExitTime プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS