Any Experts Please Help!
I am using the following VB code in Window Mobile to download a 1M file from the web server. It works very fast on Wi-Fi mode, less than 5 seconds, using my code or Internet Explorer, no discernable different.
However, on GPRS/3G mode: it takes about 5 to 10 minutes to download the same file in IE, but my VB code took 17 or sometime 40 minutes to download the file. The first 500K seems fast in about 4 minutes, still a bit slow when compare to IE, but the last 500 was so slow. What am I missing? Please help. Thanks!
Request = System.Net.WebRequest.Create(sURL)
Response = Request.GetResponse
ResponseStream = Response.GetResponseStream
Dim numBytesToRead As Integer = CInt(Response.ContentLength)
Dim bytes(Response.ContentLength) As Byte
Dim numBytesRead As Integer = 0
While numBytesToRead + 1 > 0
Dim n As Integer = ResponseStream.Read(bytes, numBytesRead, numBytesToRead)
If n = 0 Then
numBytesRead += n
numBytesToRead -= n