IWMSFileDescriptions.Count (C#)
Previous | Next |
IWMSFileDescriptions.Count (C#)
The Count property retrieves the number of IWMSFileDescription objects contained in the IWMSFileDescriptions collection.
Syntax
int = IWMSFileDescriptions.Count;
Property Value
int containing the number of IWMSFileDescription objects contained in the IWMSFileDescriptions collection.
Remarks
If the publishing point path references a playlist, the Count property returns 1. It does not retrieve the number of media files referenced by the playlist.
This property is read-only.
Example Code
using Microsoft.WindowsMediaServices.Interop; using System.Runtime.InteropServices; // Declare variables. WMSServer Server; IWMSFileDescriptions FileDescriptions; IWMSFileDescription FileDescription; string strPath; try { // Create a new WMSServer object. Server = new WMSServerClass(); // Retrieve the IWMSFileDescriptions object. strPath = "file://c:\\wmpub\\wmroot"; FileDescriptions = Server.get_FileDescriptions(strPath, WMS_FILE_TYPE.WMS_FILE_UNSPECIFIED); // Use the Count property as an iteration boundary // when accessing individual objects in the collection. for (int i = 0; i < FileDescriptions.Count; i++) { // . FileDescription = FileDescriptions[i]; } } 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 |