Make sure the Inet control has all its data

When you issue the GetChunk command for the Inet control, don't
forget to wait until it's done before continuing with code that
manipulates the return values. Depending on the user's connection
speed, the GetChunk method may take several seconds. To give the
method a chance to complete before executing the rest of the code,
use the DoEvents keyword, like so:
Private Function GetData()
Dim vData As Variant
Dim strTemp As String
Do
  vData = Inet1.GetChunk(256, icString)
  DoEvents
  If Len(vData) Then
    strTemp = strTemp & vData
    lblBytesReceived.Caption = CStr(Len(strTemp))
  End If
Loop While Len(vData)
GetData = strTemp
End Function

You might also like...

Comments

ElementK Journals

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Better train people and risk they leave – than do nothing and risk they stay.” - Anonymous