IIS 7.0: IFtpHomeDirectoryProvider.GetUserHomeDirectoryData Method

Returns the physical path of the home directory for a user.

 [C#]
string GetUserHomeDirectoryData(
   string sessionId,
   string siteName,
   string userName
)
Visual Basic
Function GetUserHomeDirectoryData(
   ByVal sessionId As String,
   ByVal siteName As String,
   ByVal userName As String
) As String
Parameters

sessionId

A string that contains the session ID.

siteName

A string that contains the site name.

userName

A string that contains the user name.

Return Value

A string that contains the physical home directory information.

Example

The following code example illustrates using the IFtpHomeDirectoryProvider interface to create a custom home directory module for the FTP service that returns a specific home directory.

using System;
using Microsoft.Web.FtpServer;

namespace FtpHomeDirectory
{
   public class FtpHomeDirDemo : BaseProvider,
      IFtpHomeDirectoryProvider
   {
      string IFtpHomeDirectoryProvider.GetUserHomeDirectoryData(
         string sessionId,
         string siteName,
         string userName)
      {
         // Note: You would add your own custom logic here.
         // Return the user's home directory based on their user name.
         return @"C:\Ftpusers\" + userName;
      }
   }
}
Requirements

Type

Description

Client

IIS 7.5

Server

IIS 7.5

Product

FTP 7.5

Reference

Microsoft.Web.FtpServer.dll

See Also

Reference

Page view tracker