This documentation is archived and is not being maintained.

WqlEventQuery.WithinInterval Property

Gets or sets the polling interval to be used in this query.

[Visual Basic]
Public Property WithinInterval As TimeSpan
public TimeSpan WithinInterval {get; set;}
public: __property TimeSpan get_WithinInterval();
public: __property void set_WithinInterval(TimeSpan);
public function get WithinInterval() : TimeSpan;
public function set WithinInterval(TimeSpan);

Property Value

Null, if there is no polling involved; otherwise, a valid TimeSpan value if polling is required.


This property should only be set in cases where there is no event provider for the event requested, and WMI is required to poll for the requested condition.

Setting this property value overrides any previous value stored in the object. The query string is rebuilt to reflect the new interval.


[Visual Basic, C#] This example creates a new WqlEventQuery that represents the query: "SELECT * FROM __InstanceModificationEvent WITHIN 10 WHERE PropVal > 8".

WqlEventQuery q = new WqlEventQuery();
q.EventClassName = "__InstanceModificationEvent";
q.Condition = "PropVal > 8";
q.WithinInterval = new TimeSpan(0,0,10);

[Visual Basic] 
Dim q As New WqlEventQuery()
q.EventClassName = "__InstanceModificationEvent"
q.Condition = "PropVal > 8"
q.WithinInterval = New TimeSpan(0,0,10)

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

WqlEventQuery Class | WqlEventQuery Members | System.Management Namespace