IWMSServer.DownloadContent (C#)

banner art

Previous Next

IWMSServer.DownloadContent (C#)

The DownloadContent method downloads audio or video media content locally using the WMS Archiver Data Writer plug-in.

Syntax

  IWMSServer
  .DownloadContent(
  string  strSrcURL,
  string  strDestFile,
  int  lContentSizeLow,
  int  lContentSizeHigh,
  int  lBitRate
);

Parameters

strSrcURL

[in] string containing the source URL of the content to be downloaded.

strDestFile

[in] string containing the destination file to store the downloaded content.

lContentSizeLow

[in] int containing the low-order bits of a 64-bit integer value indicating the maximum size for the destination file. The default value is 0xFFFFFFF.

lContentSizeHigh

[in] int containing the high-order bits of a 64-bit integer value indicating the maximum size for the destination file. The default value is 0xFFFFFFF.

lBitRate

[in] int specifying the maximum bit rate at which to download the content. The default value is 0, indicating that content will be downloaded based on the encoded bit rate of the content.

Return Values

This method does not return a value.

If this method fails, it throws an exception.

Number Description
0x80070057 One of the arguments is invalid.
0x8007000E There is insufficient memory to complete the function.

Example Code

using Microsoft.WindowsMediaServices.Interop;
using System.Runtime.InteropServices;










    // Download content from another server to a local file.
    strSrc = "https://server/Sample_Broadcast/Welcome1.asf";
    strDest = "c:\\wmpub\\wmroot\\Download_<Y><m><d>.asf";
    Server.DownloadContent (strSrc, strDest, 0xFFFFFFF,
                            0xFFFFFFF,0xFFFFFFF);
}
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