This project is read-only.

The Handle Is Invalid Error

Aug 15, 2014 at 6: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(@""); ftp.Open();

FtpDirectoryInfo[] dirs = ftp.GetDirectories();

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

In the above line of code:

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