Click here to Skip to main content
15,887,485 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Help in code in visual basic for a new vb student Pin
The Man from U.N.C.L.E.13-Nov-09 11:34
The Man from U.N.C.L.E.13-Nov-09 11:34 
AnswerRe: Help in code in visual basic for a new vb student Pin
Steven J Jowett14-Nov-09 0:17
Steven J Jowett14-Nov-09 0:17 
QuestionC# code snippet need help converting to VB Pin
bubk13-Nov-09 9:28
bubk13-Nov-09 9:28 
AnswerRe: C# code snippet need help converting to VB Pin
Dave Kreskowiak13-Nov-09 10:39
mveDave Kreskowiak13-Nov-09 10:39 
GeneralRe: C# code snippet need help converting to VB Pin
bubk13-Nov-09 10:55
bubk13-Nov-09 10:55 
AnswerRe: C# code snippet need help converting to VB Pin
Dave Doknjas13-Nov-09 11:51
Dave Doknjas13-Nov-09 11:51 
AnswerRe: C# code snippet need help converting to VB Pin
Milad.Biroonvand14-Nov-09 17:55
Milad.Biroonvand14-Nov-09 17:55 
QuestionFtpWebRequest Pin
Archimedes2413-Nov-09 6:46
professionalArchimedes2413-Nov-09 6:46 
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
AnswerRe: FtpWebRequest Pin
Dave Kreskowiak13-Nov-09 7:27
mveDave Kreskowiak13-Nov-09 7:27 
GeneralRe: FtpWebRequest Pin
Archimedes2414-Nov-09 0:59
professionalArchimedes2414-Nov-09 0:59 
GeneralRe: FtpWebRequest Pin
Dave Kreskowiak15-Nov-09 10:55
mveDave Kreskowiak15-Nov-09 10:55 
GeneralRe: FtpWebRequest Pin
Archimedes2415-Nov-09 21:25
professionalArchimedes2415-Nov-09 21:25 
QuestionDatagridView Button Column Cell Editing Control Width. Pin
priyamtheone13-Nov-09 2:38
priyamtheone13-Nov-09 2:38 
AnswerRe: DatagridView Button Column Cell Editing Control Width. Pin
Dave Kreskowiak13-Nov-09 4:45
mveDave Kreskowiak13-Nov-09 4:45 
QuestionHow to get general control of any window in VB .net Pin
mtayyab200913-Nov-09 1:41
mtayyab200913-Nov-09 1:41 
AnswerRe: How to get general control of any window in VB .net Pin
Johan Hakkesteegt13-Nov-09 2:43
Johan Hakkesteegt13-Nov-09 2:43 
AnswerRe: How to get general control of any window in VB .net Pin
EliottA13-Nov-09 2:48
EliottA13-Nov-09 2:48 
AnswerRe: How to get general control of any window in VB .net Pin
Dave Kreskowiak13-Nov-09 4:31
mveDave Kreskowiak13-Nov-09 4:31 
Questionbinding data with gridview Pin
KIDYA12-Nov-09 21:45
KIDYA12-Nov-09 21:45 
AnswerRe: binding data with gridview Pin
Johan Hakkesteegt12-Nov-09 22:46
Johan Hakkesteegt12-Nov-09 22:46 
GeneralRe: binding data with gridview Pin
KIDYA12-Nov-09 22:52
KIDYA12-Nov-09 22:52 
GeneralRe: binding data with gridview Pin
Johan Hakkesteegt12-Nov-09 23:23
Johan Hakkesteegt12-Nov-09 23:23 
GeneralRe: binding data with gridview Pin
Dave Kreskowiak13-Nov-09 4:25
mveDave Kreskowiak13-Nov-09 4:25 
AnswerRe: binding data with gridview Pin
Shameel12-Nov-09 22:51
professionalShameel12-Nov-09 22:51 
GeneralRe: binding data with gridview Pin
KIDYA12-Nov-09 22:56
KIDYA12-Nov-09 22:56 

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.