IWMSFileDescriptions.CreateDataSourceDirectory (Visual Basic .NET)
.gif)
| Previous | Next |
IWMSFileDescriptions.CreateDataSourceDirectory (Visual Basic .NET)
The CreateDataSourceDirectory method creates a new directory at the specified path, which can be used to store content.
Syntax
IWMSFileDescriptions .CreateDataSourceDirectory( strPath As String )
Parameters
strPath
[in] String containing the path and directory to create.
Return Values
If this method succeeds, it does not return a value. If it fails, it returns an error number.
| Number | Description |
| 0x8007000E | There is insufficient memory to complete the function. |
| 0xC00D1580L | The data source plug-in that the server is attempting to use to access the path referenced by strPath does not support enumeration of files. |
| 0xC00D157EL | The server was not able to find a data source plug-in to access the path referenced by strPath. |
Example Code
Imports Microsoft.WindowsMediaServices.Interop
Imports System.Runtime.InteropServices
Private Sub CreateDirectory()
' Declare variables.
Dim Server As WMSServer
Dim FileDescriptions As IWMSFileDescriptions
Dim strPath As String
Try
' Create the WMSServer object.
Server = New WMSServer()
' Retrieve the IWMSFileDescriptions object.
strPath = "file://c:\wmpub\wmroot\"
FileDescriptions = Server.FileDescriptions(strPath, WMS_FILE_TYPE.WMS_FILE_UNSPECIFIED)
' Create a new directory.
strPath = "file://c:\wmpub\wmroot\New Directory\"
FileDescriptions.CreateDataSourceDirectory(strPath)
Catch excCom As COMException
' TODO: Handle COM exceptions.
Catch exc As Exception
' TODO: Handle errors.
Finally
' TODO: Clean-up code goes here.
End Try
End Sub
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 |