using FtpServer com library in c# ? - WeOnlyDo Discussion board

using FtpServer com library in c# ? (wodFTPServer)

by shady, Sunday, December 04, 2005, 01:48 (6929 days ago)

hello all

is it possible to use the ftpserver com library in c# ?

i tried everything but cannot execute the

FtpServer_LoginPassword(wodFTPDComLib.IFtpUser User, String Login, String Password, wodFTPDComLib.FtpActions Action)

event :(

can anyone post a mini class which shows how to allow maybe anonymous connections and show DirList() ?

code i tried:


namespace test
{
public partial class Form1 : Form
{

private wodFTPDComLib.wodFTPDComClass FtpServer;
private wodFTPDComLib.FtpUserClass FtpUsers;

public Form1()
{
InitializeComponent();
this.FtpServer = new wodFTPDComLib.wodFTPDComClass();
this.FtpUsers = new wodFTPDComLib.FtpUserClass();

//CONNECTION DATA
FtpServer.Port = 1800;

//USERS DATA
this.FtpUsers.Login = shade ;
this.FtpUsers.Password = aha ;
this.FtpUsers.VirtualFolders.Add( / , APPZ , H:\client\appz );

}

private void Form1_Load(object sender, EventArgs e)
{
FtpServer.Start(1800);
}

private void FtpServer_LoginPassword(wodFTPDComLib.IFtpUser User, String Login, String Password, wodFTPDComLib.FtpActions Action)
{
Action = wodFTPDComLib.FtpActions.Allow;
this.FtpUsers.HomeDir = E:\Home ;
}

private void FtpServer_Connecting(wodFTPDComLib.IFtpUser User, wodFTPDComLib.FtpActions Action)
{
MessageBox.Show(User.Login.ToString());
Action = wodFTPDComLib.FtpActions.Allow;
}


}
}


plz guys help me out [:doh:] thx in advice :)

Re: using FtpServer com library in c# ?

by wodSupport, Sunday, December 04, 2005, 22:16 (6929 days ago) @ shady

Shady,

I don't know why you have problems. I just tried this in VS2003 and works without any problems. Here's relevant parts of the code: [code] wodFTPDComLib.wodFTPDCom Ftp1;

private void Form1_Load(object sender, System.EventArgs e)
{
Ftp1 = new wodFTPDComLib.wodFTPDComClass();
Ftp1.LoginPassword +=new wodFTPDComLib._IwodFTPDComEvents_LoginPasswordEventHandler(Ftp1_LoginPassword);
Ftp1.Start(21);
}

private void Ftp1_LoginPassword(wodFTPDComLib.FtpUser User, string Login, string Password, ref wodFTPDComLib.FtpActions Action)
{
Action = wodFTPDComLib.FtpActions.Allow;
}[/code]

Re: using FtpServer com library in c# ?

by shade, Monday, December 05, 2005, 16:30 (6928 days ago) @ wodSupport

thaks WeOnlyDo guys

works fine :)

im sorry im at the moment noob-student with only shell-experience in c/c++ :)

my gui dev experience istn very well at the moment but ill come back with skill :D

thanks again for your support and wish u for tomorrow a nice

Santa Claus Day

bye [:happy:]