kennedymr2
Programmer
Using wc As New System.Net.WebClient()
Try
wc.DownloadFile(Server1 & FileName4, Filename3)
AddHandler wc.DownloadProgressChanged, AddressOf pchanged
AddHandler wc.DownloadFileCompleted, AddressOf done
Catch ex As WebException
' MsgBox(ex.ToString)
End Try
End Using
Do While DoneX = False
System.Windows.Forms.Application.DoEvents()
Loop
Sub done(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs)
If e.Error Is Nothing Then
'MsgBox("Download completed!")
Else
'MsgBox(e.Error.Message)
End If
DoneX = True
End Sub
When i carry out the above functions in most cases it works 100% .. but on just a few files the donex does not get set to True......
When i look at the file in the output directory it is there but shows 0 size.... if i open the file in notepad there is data in there...if i completely close the program ie stop debugging......the file size does then shows up as eg 18kb..
On small files i do not have the problem, its only in larger files.
Appreciate any ideas
Regards Kennedymr2
Try
wc.DownloadFile(Server1 & FileName4, Filename3)
AddHandler wc.DownloadProgressChanged, AddressOf pchanged
AddHandler wc.DownloadFileCompleted, AddressOf done
Catch ex As WebException
' MsgBox(ex.ToString)
End Try
End Using
Do While DoneX = False
System.Windows.Forms.Application.DoEvents()
Loop
Sub done(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs)
If e.Error Is Nothing Then
'MsgBox("Download completed!")
Else
'MsgBox(e.Error.Message)
End If
DoneX = True
End Sub
When i carry out the above functions in most cases it works 100% .. but on just a few files the donex does not get set to True......
When i look at the file in the output directory it is there but shows 0 size.... if i open the file in notepad there is data in there...if i completely close the program ie stop debugging......the file size does then shows up as eg 18kb..
On small files i do not have the problem, its only in larger files.
Appreciate any ideas
Regards Kennedymr2