Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.4k views
in .NET FTP by (120 points)
I have registered event handler as follows:

ftpConnection1.LocalDirectoryChanging += new FTPDirectoryEventHandler( before_localDirectoryChange);

this is the function declaration I use:

public void before_localDirectoryChange(object sender, FTPDirectoryEventArgs e)
{
string blah = "blah";
}

The error I get on compilation event is:

error CS0120: An object reference is required for the nonstatic field, method, or property 'pcw101_PcRateProductTopRated_Loader.Class1.before_localDirectoryChange(object, EnterpriseDT.Net.Ftp.FTPDirectoryEventArgs)'

What am I doing wrong? Please help.

1 Answer

0 votes
by (162k points)
You need an object reference for the method (assuming it is created inside your class).

ftpConnection1.LocalDirectoryChanging += new FTPDirectoryEventHandler(this.before_localDirectoryChange);

Categories

...