IFtpHomeDirectoryProvider.GetUserHomeDirectoryData Method [IIS 7]
IIS 7.0
Returns the physical path of the home directory for a user.
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;
}
}
}