Interfaccia IFtpProviderConstruct

Fornisce un'interfaccia per il passaggio delle impostazioni di configurazione a un provider.

Sintassi

interface IFtpProviderConstruct : IUknown 

Metodi

Nella tabella seguente sono elencati i metodi esposti dall'interfaccia IFtpRoleProvider .

Nome Definizione
Metodo IFtpProviderConstruct::Construct Recupera una matrice di coppie chiave/valore dalle impostazioni di configurazione di un provider FTP nel file di ApplicationHost.config IIS.

Commenti

È possibile specificare i parametri per un provider FTP nel file ApplicationHost.config IIS aggiungendo una <activation> raccolta, che può contenere una serie di <providerData> elementi che elencano impostazioni aggiuntive per provider FTP personalizzati. Ogni <providerData> elemento è associato a una voce nella <providerDefinitions> raccolta e contiene una serie di coppie chiave/valore che contengono informazioni specifiche per ogni provider.

Nell'estratto di configurazione seguente viene illustrata una voce del provider FTP personalizzata nel file di ApplicationHost.config e le relative informazioni.

<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> 

Esempio

Nell'esempio di codice seguente viene eseguita l'iterazione della matrice di impostazioni di configurazione e vengono inviate le coppie chiave/valore al flusso di debug.

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; 
   } 

Requisiti

Tipo Descrizione
Client - IIS 7.5 in Windows 7
- IIS 8.0 in Windows 8
- IIS 10.0 in Windows 10
Server - IIS 7.5 in Windows Server 2008 R2
- IIS 8.0 in Windows Server 2012
- IIS 8.5 in Windows Server 2012 R2
- IIS 10.0 in Windows Server 2016
Prodotto - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0
Riferimento ftpext.tlb