Export (0) Print
Expand All

IFtpLogProvider.Initialize Method [IIS 7]

IIS 7.0

Initializes a new instance of the IFtpLogProvider interface.

protected override void Initialize(
   StringDictionary config
)

config

[IN] A StringDictionary that contains key/value pairs from the IIS configuration settings.

You can specify parameters for an FTP provider in the IIS applicationHost.config file by adding an <activation> collection, which may contain a series of <providerData> elements that list additional settings for custom FTP providers. Each <providerData> element is paired with an entry in the <providerDefinitions> collection, and contains a series of key/value pairs that contain information that is specific to each provider. By overriding the Initialize method, your module can retrieve the series of key/value pairs from the configuration store.

The following configuration excerpt illustrates a custom FTP provider entry in the applicationHost.config file and its related information.

<system.ftpServer>
   <providerDefinitions>
      <add name="FtpDemo"
         type="FtpDemo.DemoProvider,FtpDemo,version=1.0.0.0,Culture=neutral,PublicKeyToken=f0e1d2c3b4a59687" />
      <activation>
         <providerData name="FtpDemo">
            <add key="one" value="1" />
            <add key="two" value="2" />
         </providerData>
      </activation>
   </providerDefinitions>
</system.ftpServer>

The following code example iterates through the array of configuration settings and sends the key/value pairs to the debug stream.

protected override void Initialize(StringDictionary config)
{
   base.Initialize(config);
   // List the number of configuration entries for this provider.
   Debug.WriteLine("Config Entries: " + config.Count);
   if (config.Count > 0)
   {
      // Enumerate the individual configuration entries.
      foreach (DictionaryEntry entry in config)
      {
         // List the key name and value for each configuration entry.
         Debug.WriteLine(entry.Key + ": " + entry.Value);
      }
   }
}

Type

Description

Client

IIS 7.5

Server

IIS 7.5

Product

FTP 7.5

Reference

Microsoft.Web.FtpServer.dll

Community Additions

ADD
Show:
© 2014 Microsoft