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

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

WqlEventQuery.WithinInterval プロパティ

クエリ使用するポーリング間隔取得または設定します

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

Public Property WithinInterval As
 TimeSpan
Dim instance As WqlEventQuery
Dim value As TimeSpan

value = instance.WithinInterval

instance.WithinInterval = value
public TimeSpan WithinInterval { get; set;
 }
public:
property TimeSpan WithinInterval {
    TimeSpan get ();
    void set (TimeSpan value);
}
/** @property */
public TimeSpan get_WithinInterval ()

/** @property */
public void set_WithinInterval (TimeSpan value)
public function get WithinInterval
 () : TimeSpan

public function set WithinInterval
 (value : TimeSpan)

プロパティ
イベント クエリ使用するポーリング間隔格納している TimeSpan 値を返します

解説解説
使用例使用例

クエリ "SELECT * FROM __InstanceCreationEvent WITHIN 1 WHERE TargetInstance ISA 'Win32_Process'" を表す新しい WqlEventQuery を初期化する例を次に示します

Imports System
Imports System.Management

' This example shows synchronous consumption of events. 
' The client is blocked while waiting for events. 

Public Class EventWatcherPolling
    Public Overloads Shared
 Function _
        Main(ByVal args() As String)
 As Integer

        ' Create event query to be notified within 1 seconds of 
        ' a process being created
        Dim query As New
 WqlEventQuery( _
            "__InstanceCreationEvent", _
            New TimeSpan(0, 0, 1), _
            "TargetInstance isa ""Win32_Process""")

        ' Initialize an event watcher and subscribe to events 
        ' that match this query
        Dim watcher As New
 ManagementEventWatcher(query)
        ' times watcher.WaitForNextEvent in 5 seconds
        watcher.Options.Timeout = New TimeSpan(0, 0, 5)

        ' Block until the next event occurs 
        ' Note: this can be done in a loop
        ' if waiting for more than one occurrence
        Console.WriteLine( _
          "Open an application (notepad.exe) to trigger an event.")
        Dim e As ManagementBaseObject = _
            watcher.WaitForNextEvent()

        'Display information from the event
        Console.WriteLine( _
            "Process {0} has created, path is: {1}",
 _
            CType(e("TargetInstance"), _
                ManagementBaseObject)("Name"), _
            CType(e("TargetInstance"), _
                ManagementBaseObject)("ExecutablePath"))

        'Cancel the subscription
        watcher.Stop()
        Return 0

    End Function 'Main
End Class 'EventWatcherPolling
using System;
using System.Management;

// This example shows synchronous consumption of events. 
// The client is blocked while waiting for events. 

public class EventWatcherPolling 
{
    public static int Main(string[]
 args) 
    {
        // Create event query to be notified within 1 second of 
        // a new process being created
        WqlEventQuery query = 
            new WqlEventQuery("__InstanceCreationEvent",
 
            new TimeSpan(0,0,1), 
            "TargetInstance isa \"Win32_Process\"");

        // Initialize an event watcher and subscribe to events 
        // that match this query
        ManagementEventWatcher watcher =
            new ManagementEventWatcher(query);
        // times out watcher.WaitForNextEvent in 5 seconds
        watcher.Options.Timeout = new TimeSpan(0,0,5);
      
        // Block until the next event occurs 
        // Note: this can be done in a loop if waiting for 
        //        more than one occurrence
        Console.WriteLine(
            "Open an application (notepad.exe) to trigger an event.");
        ManagementBaseObject e = watcher.WaitForNextEvent();

        //Display information from the event
        Console.WriteLine(
            "Process {0} has been created, path is: {1}", 
            ((ManagementBaseObject)e
            ["TargetInstance"])["Name"],
            ((ManagementBaseObject)e
            ["TargetInstance"])["ExecutablePath"]);

        //Cancel the subscription
        watcher.Stop();
        return 0;
    }
}
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS