Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
.gif)
| Previous | Next |
IWMSLoggingAdmin.Cycle (C#)
The Cycle property specifies and retrieves an enumeration value indicating how often the log file cycles.
Syntax
IWMSLoggingAdmin .Cycle = WMS_LOG_CYCLE_TYPE; WMS_LOG_CYCLE_TYPE = IWMSLoggingAdmin.Cycle;
Property Value
A member of the WMS_LOG_CYCLE_TYPE enumeration type indicating how often the log file cycles. This must be one of the following values.
| Value | Description |
| WMS_LOG_CYCLE_NONE | The log file never cycles. |
| WMS_LOG_CYCLE_SIZE | The log file cycles based on the specified size. |
| WMS_LOG_CYCLE_MONTH | The log file cycles monthly. |
| WMS_LOG_CYCLE_WEEK | The log file cycles weekly. |
| WMS_LOG_CYCLE_DAY | The log file cycles daily. |
| WMS_LOG_CYCLE_HOUR | The log file cycles hourly. |
If this property fails, it throws an exception.
| Number | Description |
| 0x80004005 | The server cannot find the WMS Client Logging plug-in. |
| 0x80070057 | The value you specified does not contain a member of the WMS_LOG_CYCLE_TYPE enumeration. |
Remarks
A log file cycles when the existing file is removed and a new log file is created.
Example Code
using Microsoft.WindowsMediaServices.Interop;
using System.Runtime.InteropServices;
// Declare variables.
WMSServer Server;
IWMSPlugin Plugin;
IWMSLoggingAdmin LogAdmin;
try {
// Create a new WMSServer object.
Server = new WMSServerClass();
// Retrieve the plug-in to be configured.
Plugin = Server.EventHandlers[
"WMS Client Logging"];
// Retrieve the custom interface of the plug-in.
LogAdmin =
(IWMSLoggingAdmin)Plugin.CustomInterface;
// Set the enumeration value indicating
// how often the log file is cycled.
LogAdmin.Cycle = WMS_LOG_CYCLE_TYPE.WMS_LOG_CYCLE_DAY;
}
catch (COMException comExc) {
// TODO: Handle COM exceptions.
}
catch (Exception e) {
// TODO: Handle exceptions.
}
Requirements
Reference: Add a reference to Microsoft.WindowsMediaServices.
Namespace: Microsoft.WindowsMediaServices.Interop.
Assembly: Microsoft.WindowsMediaServices.dll.
Library: WMSServerTypeLib.dll.
Platform: Windows Server 2003 family, Windows Server 2008 family.
See Also
| Previous | Next |