Solved

Little problem with Inet

Posted on 2002-06-23
5
206 Views
Last Modified: 2010-05-02
I have to download the HTML of a page that is very big so I want that while its being downloded, to put the HTML in a Textbox. This is how I'm trying that:


If State = 12 Or State = 8 Then

    bloque = Inet1.GetChunk(1024, icString)
    DoEvents
    Do While Not bDone
       des = des & bloque
       DoEvents
       ' Obtiene el bloque siguiente.
       bloque = Inet1.GetChunk(1024, icString)
       If Len(des) = 0 Then
          bDone = True
       End If
    Loop
end if

But I get some errors. I dont use just the state 12 because it will waits until the whole page is downloaded...

What can I do?
0
Comment
Question by:DImirC
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 1

Accepted Solution

by:
Toad224 earned 200 total points
ID: 7102474
Why don't you try this...  It seems to work well for me...

Private Sub Command1_Click()
Inet1.Execute "http://www.microsoft.com/"
End Sub

Private Sub Inet1_StateChanged(ByVal State As Integer)
 Select Case State
        Case icResponseCompleted
            Do
                DoEvents
                strBuffer = Inet1.GetChunk(1024)
                Text1.Text = Text1.Text & strBuffer
            Loop Until Len(strBuffer) = 0
End Select
End Sub


I hope this helps.  Good luck!
0
 

Author Comment

by:DImirC
ID: 7111308
But the problem is that the page is very very big, about 5000 lines, so I dont want to wait until it is complete... I want the HTML to be shown inmediatly after its downloaded
0
 
LVL 1

Expert Comment

by:Toad224
ID: 7111324
When I use the code I put above, it shows the downloaded data as it is downloaded instead of waiting until it's complete.  Do    strBuffer = Inet1.GetChunk(10)    instead of the 1024 one to see the data appear faster.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7962856
Hi DImirC,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept Toad224's comment(s) as an answer.
    *** I don't think the answer is 100% correct since the code needs to handle icResponseReceived, but it does show that the text must be appended to the output as it comes in.

DImirC, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 5

Expert Comment

by:Netminder
ID: 8022916
Per recommendation, force-accepted.

Netminder
EE Admin
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question