IFtpProviderConstruct, interface

Fournit une interface pour transmettre des paramètres de configuration à un fournisseur.

Syntaxe

interface IFtpProviderConstruct : IUknown 

Méthodes

Le tableau suivant répertorie les méthodes exposées par l’interface IFtpRoleProvider .

Nom Définition
IFtpProviderConstruct::Construct, méthode Récupère un tableau de paires clé/valeur à partir des paramètres de configuration d’un fournisseur FTP dans le fichier de ApplicationHost.config IIS.

Remarques

Vous pouvez spécifier des paramètres pour un fournisseur FTP dans le fichier de ApplicationHost.config IIS en ajoutant une <activation> collection, qui peut contenir une série d’éléments <providerData> qui répertorient des paramètres supplémentaires pour les fournisseurs FTP personnalisés. Chaque <providerData> élément est associé à une entrée dans la <providerDefinitions> collection et contient une série de paires clé/valeur qui contiennent des informations spécifiques à chaque fournisseur.

L’extrait de configuration suivant illustre une entrée de fournisseur FTP personnalisée dans le fichier ApplicationHost.config et ses informations associées.

<system.ftpServer> 
   <providerDefinitions> 
      <add name="FtpDemo" 
         clsid="FtpDemo.DemoProvider" /> 
      <activation> 
         <providerData name="FtpDemo"> 
            <add key="one" value="1" /> 
            <add key="two" value="2" /> 
         </providerData> 
      </activation> 
   </providerDefinitions> 
</system.ftpServer> 

Exemple

L’exemple de code suivant itère dans le tableau des paramètres de configuration et envoie les paires clé/valeur au flux de débogage.

public: 
   STDMETHOD(Construct)(SAFEARRAY * configurationEntries) 
   { 
      CONFIGURATION_ENTRY * pArray; 
      HRESULT hr = S_OK; 
      LONG lLbound = 0; 
      LONG lUbound = 0; 
 
      OutputDebugString(L"IFtpProviderConstruct::Construct\n"); 
 
      // Retrieve the upper and lower bounds for the configuration array. 
      SafeArrayGetLBound( configurationEntries, 1, &lLbound ); 
      SafeArrayGetUBound( configurationEntries, 1, &lUbound ); 
 
      // Retrieve a pointer to the array of configuration settings. 
      hr = SafeArrayAccessData(configurationEntries, (void**)&pArray); 
      // Return an error if a failure occurs. 
      if (FAILED(hr)) 
      { 
         return hr; 
      } 
 
      // Loop through the array of configuration setttings and 
      // output the key/value pairs to the debug channel. 
      for(LONG Index = lLbound; Index <= lUbound; Index ++) 
      { 
         OutputDebugString(pArray[Index].bstrKey); 
         OutputDebugString(pArray[Index].bstrValue); 
      } 
 
      // Release the pointer to the array of configuration settings. 
      hr = SafeArrayUnaccessData(configurationEntries); 
      // Return an error if a failure occurs. 
      if (FAILED(hr)) 
      { 
         return hr; 
      } 
 
      return S_OK; 
   } 

Spécifications

Type Description
Client - IIS 7.5 sur Windows 7
- IIS 8.0 sur Windows 8
- IIS 10.0 sur Windows 10
Serveur - IIS 7.5 sur Windows Server 2008 R2
- IIS 8.0 sur Windows Server 2012
- IIS 8.5 sur Windows Server 2012 R2
- IIS 10.0 sur Windows Server 2016
Produit - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0
Informations de référence ftpext.tlb