Export (0) Print
Expand All

WqlEventQuery.WithinInterval Property

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

[Visual Basic]
Public Property WithinInterval As TimeSpan
[C#]
public TimeSpan WithinInterval {get; set;}
[C++]
public: __property TimeSpan get_WithinInterval();
public: __property void set_WithinInterval(TimeSpan);
[JScript]
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.

Remarks

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.

Example

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

[C#] 
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.

Requirements

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

Show:
© 2014 Microsoft