Click here to Skip to main content
15,891,942 members

Archimedes24 - Professional Profile



Summary

    Blog RSS
20
Author
25
Authority
-87
Debator
7
Editor
14
Enquirer
222
Organiser
1,679
Participant
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

 

Reputation

Weekly Data. Recent events may not appear immediately. For information on Reputation please see the FAQ.

Privileges

Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege. The member types column lists member types who gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilver
Bypass spam checks when posting contentsilversilversilversilversilversilvergoldSubEditor, Mentor, Protector, Editor
Store personal files in your account areaplatinumplatinumSubEditor, Editor
Have live hyperlinks in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Have the ability to include a biography in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Edit a Question in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Edit an Answer in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Delete a Question in Q&AYesSubEditor, Protector, Editor
Delete an Answer in Q&AYesSubEditor, Protector, Editor
Report an ArticlesilversilversilversilverSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubEditor, Mentor, Protector, Editor
Edit other members' articlesSubEditor, Protector, Editor
Create an article without requiring moderationplatinumSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending QuestionProtector
Approve/Disapprove a pending AnswerProtector
Report a forum messagesilversilverbronzeProtector, Editor
Approve/Disapprove a pending Forum MessageProtector
Have the ability to send direct emails to members in the forumsProtector
Create a new tagsilversilversilversilver
Modify a tagsilversilversilversilver

Actions with a green tick can be performed by this member.


 
QuestionFTPWebRequest Pin
Archimedes2413-Nov-09 6:43
professionalArchimedes2413-Nov-09 6:43 
Hi,

I have a small FTP class, written in VB.NET 2.0, which keeps polling for a particular file at a remote location, at 2 minute intervals, till it successfully downloads the file, and then it stops.

So far I had been using wget as an external process, and recently I have switched to using the FtpWebRequest class.

Now what i have noticed is that the first attempt always fails, even if the particular file is available on the remote server. The error returned is System.Net.WebException.

However, in the next run, after 2 minutes, the process succeeds, with exactly the same parameters.

The relevant part of the code:

Dim myFtpWebRequest As FtpWebRequest
       Dim myFtpWebResponse As FtpWebResponse
       Dim myStreamWriter As StreamWriter
       Dim strURL As String = ""

       strURL = "ftp://" & strFTPURL & strFTPFolder & strFileName

       myFtpWebRequest = DirectCast(WebRequest.Create(strURL), FtpWebRequest)
       myFtpWebRequest.KeepAlive = False
       myFtpWebRequest.Timeout = 20000
       myFtpWebRequest.UsePassive = blnUsePassive
       myFtpWebRequest.UseBinary = True


       myFtpWebRequest.Credentials = New NetworkCredential(strFTPUserName, strFTPPassword)
       myFtpWebRequest.Method = WebRequestMethods.Ftp.DownloadFile
       myFtpWebResponse = myFtpWebRequest.GetResponse()


Can someone throw some light on this?

Regards
RB

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.