Solved

VB5 Internet Question

Posted on 1998-08-31
6
205 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Accepted Solution

by:
AJElcocks earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

762 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

10 Experts available now in Live!

Get 1:1 Help Now