Results 1 to 6 of 6

Thread: [RESOLVED] Whats the best way to display website info?

  1. #1

    Thread Starter
    Member Motaro's Avatar
    Join Date
    Apr 2008
    Posts
    62

    Resolved [RESOLVED] Whats the best way to display website info?

    Wondering, what's the best way to display text from a website to your form?

  2. #2
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: Whats the best way to display website info?

    webbrowser control.

  3. #3

    Thread Starter
    Member Motaro's Avatar
    Join Date
    Apr 2008
    Posts
    62

    Re: Whats the best way to display website info?

    Aside from using a webbrowser control.

    Like if I just want to display some text from a website to a label on my form.

  4. #4
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    Re: Whats the best way to display website info?

    You can use Inet for that.

    Add a Command button, a label and the Inet control (Microsoft Internet Transfer Control in the components list) to your form

    The code below gets the text from your starting post and shows it in a label.

    Code:
    Private Sub Command1_Click()
        Dim strText As String
        Dim x As Long, y As Long
        
        strText = Inet1.OpenURL("http://www.vbforums.com/showthread.php?t=529677")
        
        y = InStr(1, strText, "<!-- message -->")
        If y Then
            x = InStr(y + 20, strText, ">")
            If x Then
                y = InStr(x, strText, "</div>")
                If y Then
                    Label1.Caption = Mid$(strText, x + 1, (y - x) - 1)
                End If
            End If
        End If
    End Sub

  5. #5

    Thread Starter
    Member Motaro's Avatar
    Join Date
    Apr 2008
    Posts
    62

    Re: Whats the best way to display website info?

    Thanks a bunch.

  6. #6
    Addicted Member
    Join Date
    Sep 2002
    Location
    Guwahati, Assam, India
    Posts
    131

    Re: [RESOLVED] Whats the best way to display website info?

    Can you please check why the same process is not working for me at http://www.vbforums.com/showthread.php?t=529914
    I am new to VB...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width