EN
Dieser Inhalt ist in Ihrer Sprache leider nicht verfügbar. Im Folgenden finden Sie die englische Version.

IBITSExtensionSetup interface

Use the IBITSExtensionSetup interface to enable or disable BITS uploads to a virtual directory.

This interface is an ADSI extension. To get a pointer to this interface, call the ADsGetObject ADSI function as shown in Example Code.

If you use this interface from a setup program that also installs the BITS server, you must call the IBITSExtensionSetupFactory::GetObject method to get a pointer to this interface instead of calling the ADsGetObject function.

Members

The IBITSExtensionSetup interface inherits from the IUnknown interface. IBITSExtensionSetup also has these types of members:

Methods

The IBITSExtensionSetup interface has these methods.

MethodDescription
DisableBITSUploads

Disables BITS uploads on the virtual directory to which the ADSI object points.

EnableBITSUploads

Enables BITS uploads on the virtual directory to which the ADSI object points.

GetCleanupTask

Returns an interface to the cleanup task associated with the virtual directory. The cleanup task removes orphaned files from the virtual directory.

GetCleanupTaskName

Returns the cleanup task name associated with the virtual directory.

 

Remarks

This interface is registered on the server when you install the BITS server extension.

On Windows Server 2003, use the Windows Components Wizard to install the BITS server extension. From Control Panel, select Add or Remove Programs. Then, select Add/Remove Windows Components to display the Windows Components Wizard. The BITS server extension is a sub-component of Internet Information Services (IIS) which is a sub-component of Web Application Server.

Examples

The following example shows how to use the ADsGetObject function to get a pointer to the IBITSExtensionSetup interface.


//Set the BITSUploadEnabled IIS configuration setting.
//The pszPath parameter contains the path to the directory service. 
//For example, "IIS://<machine name>/w3svc/1/<virtual directory>".
//The Enable parameter contains true (enable) or false (disable).
HRESULT SetBITSUploadEnabledSetting(LPWSTR pszPath, bool Enable)
{
  HRESULT hr;
  IBITSExtensionSetup* pExtensionSetup = NULL;

  hr = ADsGetObject(pszPath, __uuidof(IBITSExtensionSetup), &pExtensionSetup);
  if (SUCCEEDED(hr))
  {
    if (Enable)
    {
      hr = pExtensionSetup->EnableBITSUploads();
    }
    else
    {
      hr = pExtensionSetup->DisableBITSUploads();
    }

    pExtensionSetup->Release();
  }

  return hr;
}

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Redistributable

BITS 1.5 on Windows XP

Header

Bitscfg.h

IDL

Bitscfg.idl

DLL

BitsMgr.dll

IID

IID_IBITSExtensionSetup is defined as 29CFBBF7-09E4-4B97-B0BC-F2287E3D8EB3

See also

IBITSExtensionSetupFactory

 

 

Anzeigen: