G
Guest
Below is the code that I use to upload large files from my web server virtual
directory. This code locks up my application for quite a while when a large
file is moving. What modifications will allow this code to execute in a
asynchronous manner?
Function GetImageFromURL(ByVal url As String) As Byte()
Dim wr As HttpWebRequest = DirectCast(WebRequest.Create(url),HttpWebRequest)
If Not ProxyObject Is Nothing Then wr.Proxy = ProxyObject
Dim wresponse As HttpWebResponse = DirectCast(wr.GetResponse, HttpWebResponse)
Dim responseStream As Stream = wresponse.GetResponseStream
Dim br As BinaryReader = New BinaryReader(responseStream)
Dim bytesize As Long = wresponse.ContentLength
Return br.ReadBytes(bytesize)
End Function
directory. This code locks up my application for quite a while when a large
file is moving. What modifications will allow this code to execute in a
asynchronous manner?
Function GetImageFromURL(ByVal url As String) As Byte()
Dim wr As HttpWebRequest = DirectCast(WebRequest.Create(url),HttpWebRequest)
If Not ProxyObject Is Nothing Then wr.Proxy = ProxyObject
Dim wresponse As HttpWebResponse = DirectCast(wr.GetResponse, HttpWebResponse)
Dim responseStream As Stream = wresponse.GetResponseStream
Dim br As BinaryReader = New BinaryReader(responseStream)
Dim bytesize As Long = wresponse.ContentLength
Return br.ReadBytes(bytesize)
End Function