FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsSystem AdministrationFTP Help
View Poll Results: Have you encountered any situation where you have to restart to make your code work?
Yes 1 100.00%
No 0 0%
Voters: 1. You may not vote on this poll


Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 23rd, 2011, 02:28 AM
purem23 purem23 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2011
Posts: 1 purem23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 23 sec
Reputation Power: 0
Getting error and need to restart the service

Hi,

The FTP Server is in Passive mode. and below is the code that I have written.

FtpWebRequest reqFTP = null;
try
{
reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + ftpURL));
if (!string.IsNullOrEmpty(FTPUser) && !string.IsNullOrEmpty(FTPPassword))
{
reqFTP.Credentials = new NetworkCredential(FTPUser, FTPPassword);
}
reqFTP.Proxy = null;
reqFTP.KeepAlive = false;
reqFTP.Method = WebRequestMethods.Ftp.ListDirectory;
StreamReader outputStream = new StreamReader(reqFTP.GetResponse().GetResponseStream());

string strFileName = null;
if (outputStream != null)
strFileName = outputStream.ReadLine();

}


This does picks up the files but at times (very rare) that even if the file is present in the FTP location the program is not able to get the file listing and I have to restart the service to make it work. I dont know why a restart is necessary. The default value of reqFTP.The default value of reqFTP.UsePassive is true, so I have not explicitly set it to true. Please advice, what could be the problem !!! (I want to avoid the restarting of Service to make it FTP work again.)


Regards,
MH

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > Getting error and need to restart the service

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap