The Handle Is Invalid Error

Aug 15, 2014 at 5:57 PM
Hi. I am getting a "the handle is invalid" error when I try to get directories. I have tried both getting the current directory and get directories method and I still get the error.

FtpConnection ftp = new FtpConnection(@"10.0.151.20"); ftp.Open();

ftp.GetCurrentDirectory());
FtpDirectoryInfo[] dirs = ftp.GetDirectories();

Note:
int ret = WININET.FtpGetCurrentDirectory(_hConnect, str, ref buffLength);

In the above line of code:

_hConnect = 0
str = {}
buffLength = 261
Apr 12, 2015 at 4:05 PM
I think you forgot to call method ftp.Login();