Description
Use this property to specify the number of events to be posted to the test log by the PostEventsInfo
method.
Declaration
Applies To
The property is applied to the following object:
Property Value
An integer value that specifies the number of events to be posted.
Example
The following example demonstrates how to connect to the WMI service on a local computer and post different information about the computer to the log.
JavaScript, JScript
function Test()
{
// Specifies the local computer using the ComputerName property
WMI.ComputerName = ".";
// Using the ConnectToComputer method
// WMI.ConnectToComputer(".", "", "");
// Using the WaitForComputer method
// WMI.WaitForComputer(".", "", "", 1000000);
// Posts different information about the computer to the log
WMI.PostProcessorInfo();
WMI.PostDrivesInfo();
WMI.PostInstalledAppsInfo();
WMI.PostEnvironmentVariableInfo();
WMI.MaxEventCount = 5;
WMI.PostEventsInfo();
}
Python
def Test1():
# Specifies the local computer using the ComputerName property
WMI.ComputerName = "."
# Using the ConnectToComputer method
#WMI.ConnectToComputer(".", "", "");
# Using the WaitForComputer method
#WMI.WaitForComputer(".", "", "", 1000000);
# Posts different information about the computer to the log
WMI.PostProcessorInfo();
WMI.PostDrivesInfo();
WMI.PostInstalledAppsInfo();
WMI.PostEnvironmentVariableInfo();
WMI.MaxEventCount = 5;
WMI.PostEventsInfo();
VBScript
Sub Test
' Specifies the local computer using the ComputerName property
WMI.ComputerName = "."
' Using the ConnectToComputer method
' Call WMI.ConnectToComputer(".", "", "")
' Using the WaitForComputer method
' Call WMI.WaitForComputer(".", "", "", 1000000)
' Posts different information about the computer to the log
Call WMI.PostProcessorInfo
Call WMI.PostDrivesInfo
Call WMI.PostInstalledAppsInfo
Call WMI.PostEnvironmentVariableInfo
WMI.MaxEventCount = 5
Call WMI.PostEventsInfo
End Sub
DelphiScript
procedure Test;
begin
// Specifies the local computer using the ComputerName property
WMI.ComputerName := '.';
// Using the ConnectToComputer method
// WMI.ConnectToComputer('.', '', '');
// Using the WaitForComputer method
// WMI.WaitForComputer('.', '', '', 1000000);
// Posts different information about the computer to the log
WMI.PostProcessorInfo;
WMI.PostDrivesInfo;
WMI.PostInstalledAppsInfo;
WMI.PostEnvironmentVariableInfo;
WMI.MaxEventCount := 5;
WMI.PostEventsInfo;
end;
C++Script, C#Script
function Test()
{
// Specifies the local computer using the ComputerName property
WMI["ComputerName"] = ".";
// Using the ConnectToComputer method
// WMI["ConnectToComputer"](".", "", "");
// Using the WaitForComputer method
// WMI["WaitForComputer"](".", "", "", 1000000);
// Posts different information about the computer to the log
WMI["PostProcessorInfo"]();
WMI["PostDrivesInfo"]();
WMI["PostInstalledAppsInfo"]();
WMI["PostEnvironmentVariableInfo"]();
WMI["MaxEventCount"] = 5;
WMI["PostEventsInfo"]();
}