FTP Problem
I am trying to login to an FTP server, to download a file. Every time I try, I get the following message:
"The remote server returned an error: (530) Not logged in."
I can login and download the file using DOS FTP, and CuteFTP from this server without a problem. I also changed the code to reflect a different server, and that worked fine. When I login to the server, it identifies itself as "Microsoft FTP Service".
Can anyone point me in the right direction? Below is my code:
request = (FtpWebRequest)FtpWebRequest.Create(fileName);
request.Credentials = new NetworkCredential(userName, passWord);
request.KeepAlive = false;
request.UseBinary = false;
request.UsePassive = false;
request.Method = WebRequestMethods.Ftp.DownloadFile;
response = (FtpWebResponse)request.GetResponse();
using (reader = new StreamReader(response.GetResponseStream()))
{
string streamContent = reader.ReadToEnd();
//Console.WriteLine(streamContent);
writer = new StreamWriter(fileName, true);
writer.Write(streamContent);
writer.Close();
}
Thanks,
Russ

