Good forum for ftpWebResponse?

  • Thread starter Thread starter Jeremy
  • Start date Start date
J

Jeremy

I'm finding very limited number of places where there is a dialog on
ftpWebResponse. Can anyone suggest a place to try?
 
Jeremy said:
I'm finding very limited number of places where there is a dialog on
ftpWebResponse. Can anyone suggest a place to try?

Why not here or in the .framework group ?

Arne
 
Why not here or in the .framework group ?

Not getting responses here. dotnet.framework doesn't have much activity,
and none of the few ftp posts have been responded to.

Jeremy
 
It wasn't clear to me from your previous post how you were getting a valid
directory on the site prior to your function call. The error code returned,
as I understand it, means you don't have permissions.

Does the error occur every other time, or on particular paths?
 
Family Tree Mike said:
It wasn't clear to me from your previous post how you were getting a valid
directory on the site prior to your function call. The error code
returned,
as I understand it, means you don't have permissions.

Does the error occur every other time, or on particular paths?

The error occurs every-other time. The path is contained in an object
property, and since you raise the question, I examined it in the debugger.
The path is correct, and the credentials are correct -- the same ones that
work every-other time

The connection does eventually succeed. It's as if the first call succeeds,
the second attempt fails, but "fixes" the connection somehow, and then the
3rd attempt succeeds.
 
I added the following loop code, and it seems to sidestep the problem. The
getResponse() throws an exception, it's caught, and I try again, succeeding.

bool connected=false;
....
while ((!connected) & (i<2))
{
FtpWebRequest request =
(FtpWebRequest)WebRequest.Create(ftpPath);
request.UsePassive = false;
request.Method = WebRequestMethods.Ftp.ListDirectory;
request.Credentials = new NetworkCredential(ftpUserID,
ftpPassword);

try
{
response = (FtpWebResponse)request.GetResponse();
connected = true;
}
catch (Exception ex)
{
exMsg = ex.Message;
i += 1;
request.Abort();
}
}
 
It sounds like a tempermental ftp server. Must be a government site...
 
Jeremy said:
I'm finding very limited number of places where there is a dialog on
ftpWebResponse. Can anyone suggest a place to try?

If you post a compilable piece of code that demonstrates the
problem with a FTP server that is public available, then I am
pretty sure that you will get a solution/workaround.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top