How can I temporary map a FTP server to a network folder?
I'm creating an application to synchronize a local folder on my computer with a FTP server.
Since I don't wan't to access the FTP server directly over it's address, because it would be really complicated, I wan't to map the server temporary to a network folder so that my synchronization algorithm can work on it like on a local folder.
Is there something like this:
//Map the server to the specified path
FtpMapper.MapFtpServer("ftp://myserver/", "username", "password", "M:\\");
DirectoryInfo info = new Di开发者_运维知识库rectoryInfo("M:\\");
/* Do some work on the directory */
FtpMapper.UnmapFtpServer();
There isn't such a library, as far as I know.
This requires a windows filesystem driver that understands FTP commands and a .NET wrapper over it.
I have seen such drivers (without a wrapper) as part of commercial FTP suites, but nothing open source or free.
NetDrive boasts offering an SDK that lets you use it (netdrive) from your application. This is your only option if you don't want to write FTP code (or use third-party FTP component).
A programming solution to your task would be to take our Callback File System (to create a virtual drive) and our FTPSBlackbox (FTP/FTPS components for .NET) and combine them in your application.
精彩评论