Solved

VB5 Internet Question

Posted on 1998-08-31
6
206 Views
Last Modified: 2010-04-30
Was wondering if anyone can help to point me in the right direction with this project:

I need my app created in VB5 to look in a database for a list of URLs.  Take each URL, one by one, and look in the source code of that URL's site for a specific word, then record for each URL, whether or not that keyword was found, then move to the next til the end of the list is reached.  If the URL can't be loaded, then the app would move to the next one, maybe in a certain time.

I'm game for using an ActiveX control, or anything for that matter.  Any help would be appreciated.  Points will be awarded to the person who give the most detailed help/instructions.. Thanks!
0
Comment
Question by:EvanL
  • 4
  • 2
6 Comments
 

Expert Comment

by:AJElcocks
ID: 1432145
You can use the Microsoft INET ActiveX control to retrieve files via the web using http or ftp. The files and doc are available for download from the MSDN. Look for the internet sdk.

Dim sHtml as string
sHtml = MDIForm1.Inet1.OpenURL("http:\\whatever")

The value is returned to sHtml since the OpenURL method is not Asynchronous, so be certain to set the RequestTimout parameter. You can, however, check the StateChanged event for results and retieve data in chunks...

Private Sub Inet1_StateChanged(ByVal State As Integer)
        Dim sDtTm As String, rc As Integer
        Select Case State
        Case 11 'icError
            'Error processing here
            Exit Sub
        Case 12 '
            sData = Me.Inet1.GetChunk(length, 0)
           
        Case Else
            'interim "handshake" stuff explained in doc
        End Select
End Sub

Then use the InStr function to look for your keywords.


good luck
0
 
LVL 1

Author Comment

by:EvanL
ID: 1432146
AJElcocks:  Thanks for the info.. I'm opening the question for a few different suggestions, but will award points to the best, most comprehensive answer.  I'm only going to keep it open for maybe 5-7 more replies, then get the person with the best answer to re-submit theirs as an answer.

Thanks!
0
 
LVL 1

Author Comment

by:EvanL
ID: 1432147
A question.. I know how to get a webpage using the Inet control, but not just the source code (which is all I need).  I don't need a visual page, but the HTML behind it.

Thanks!
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Accepted Solution

by:
AJElcocks earned 100 total points
ID: 1432148
Open a new project in VB then right click on the toolbox. Select "Microsoft Internet Transfer Control" (NOT Microsoft Internet Controls) and click OK.

Put two text box controls on a form. Keep text1 as single line, make Text2 multiline.

Place the following code in the form...

Private Sub Text1_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        RichTextBox1.Text = Inet1.OpenURL(Text1.Text, 0)
    End If
End Sub

Run the project, key "www.experts-exchange.com" in Text1 and press enter. You will see the source code in text2.
0
 
LVL 1

Author Comment

by:EvanL
ID: 1432149
A question.. I know how to get a webpage using the Inet control, but not just the source code (which is all I need).  I don't need a visual page, but the HTML behind it.

Thanks!
0
 
LVL 1

Author Comment

by:EvanL
ID: 1432150
AJElcocks: Thanks for the perfect reply..  Any additional info you might have on this topic would be greatly appreciated..

EvanL
imagix@vni.net
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

911 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now