ftpServer component in .NET (wodFTPServer)
Hi..
I have installed the demo version of this server.
I would like to use this component in a C# code and listen for events about file deleted, added, folder created/deleted etc..
Can anyone point me to some sample code.
Re: ftpServer component in .NET
Hi,
You can add events to C# by doing something like this:
[code]ftpd.Connected += new wodFTPDComLib._IwodFTPDComEvents_ConnectedEventHandler(ftpd_Connected);[/code]
ftpd in this case is declared as an instance of wodFtpServer. When you are typing in VS IDE, and do += , you should be able to just push TAB key twice, and VS should automatically add Event to the code.
Can you please try?
Regards,
Damba
Re: ftpServer component in .NET
Hi,
You can add events to C# by doing something like this:
[code]ftpd.Connected += new wodFTPDComLib._IwodFTPDComEvents_ConnectedEventHandler(ftpd_Connected);[/code]
ftpd in this case is declared as an instance of wodFtpServer. When you are typing in VS IDE, and do += , you should be able to just push TAB key twice, and VS should automatically add Event to the code.
Can you please try?
Regards,
Damba
Re: ftpServer component in .NET
ok..not sure whats the deal with reply with quote..
Thanks for the response..
I ended up using the Notifications. And I am able to get the notifications
I have few questions
1) How can I restrict the user to connect to a a specific URL..for eg.,
ftp://server/dir1
I want to disallow them to connect to ftp://server
2) How can i set the root (default) directory for ftpserver..It appears the default directory is whichever directory it is running from
3) I have added few virtual directories..can I set individual permissions to them? Like read only, read/write etc
Re: ftpServer component in .NET
Hi,
Regarding 1., and 2., you can do this simply by setting HomeDir, available in User object. Probably the most appropriate place for this would be Connected or LoginPassword event/notification.
You can do something as simple as this:
[code]User.HomeDir = @ C:someFolder [/code]
As for the last question, you should use events/notifications and set Allow property to Deny for actions that aren't allowed. You should have RelativePath and ResolvedPath which should allow you to verify what folder is being accessed.
Hope this helps.
Regards,
Damba