IWMSFileDescription.Name (C#)
.gif)
| Previous | Next |
IWMSFileDescription.Name (C#)
The Name property retrieves the name of a directory, media file, or playlist file.
Syntax
string = IWMSFileDescription.Name;
Property Value
A string containing the name.
If this property fails, it throws an exception.
| Number | Description |
| 0x8007000E | There is insufficient memory to complete the function. |
Remarks
This property is read-only.
This method requires the Network Service account to have read and browse access to the file being described.
Example Code
using Microsoft.WindowsMediaServices.Interop;
using System.Runtime.InteropServices;
// Declare variables.
WMSServer Server;
IWMSFileDescriptions FileDescriptions;
IWMSFileDescription FileDescription;
string strName;
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);
// Retrieve information associated with each description.
for (int i = 0; i < FileDescriptions.Count; i++)
{
FileDescription = FileDescriptions[i];
// Retrieve the name of the file.
strName = FileDescription.Name;
}
}
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 |