help with making a web browser ( vb6)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ooroboo
    New Member
    • Feb 2008
    • 20

    help with making a web browser ( vb6)

    i was wondering if there was a easy way of adding favorites , history and make it so my combobox updates went entering a new website on my web browser , code would be helpful and as i'm new for vb would be great of you to do a little explaining too (if possible) .

    thanks for your help (using visual basic 6)
  • jeffstl
    Recognized Expert Contributor
    • Feb 2008
    • 432

    #2
    I guess I would ask for a little more info. If you have a web browser built in vb6.0 I would imagine somewhere there is a variable holding the current URL for the page you are on.

    Just grab that variable on every load of a page and write it to a text file for a history of pages visited. It will need to be a global variable too (so that all functions\subs can use it)

    For a favorite make a command button or drop down command, that grabs that same variable (that holds the URL) except write to a seperate txt file for favorites.

    For writing to txt file from VB6.0 you need to use the FSO (File System Object), and you will need this same control when you read from that text file to re-print your URLs. I would start there and see how it goes.

    In the below code I am assuming that MyURLString is a variable declared and set at a upper level of code.
    Dim MyURLString as String
    MyURLString = (wherever this can be found in your code on a page load for the address bar)

    'Code to get a favorite saved
    Private Sub Command1_Click( )
    'Declare variables.
    Dim fso As New FileSystemObjec t
    Dim ts As TextStream
    'Open file.
    Set ts = fso.OpenTextFil e("C:\Windows\M yFile.txt")
    ts.Write(MyURLS tring)
    'Close the file.
    ts.Close
    End Sub

    Comment

    • ooroboo
      New Member
      • Feb 2008
      • 20

      #3
      Originally posted by jeffstl
      I guess I would ask for a little more info. If you have a web browser built in vb6.0 I would imagine somewhere there is a variable holding the current URL for the page you are on.

      Just grab that variable on every load of a page and write it to a text file for a history of pages visited. It will need to be a global variable too (so that all functions\subs can use it)

      For a favorite make a command button or drop down command, that grabs that same variable (that holds the URL) except write to a seperate txt file for favorites.

      For writing to txt file from VB6.0 you need to use the FSO (File System Object), and you will need this same control when you read from that text file to re-print your URLs. I would start there and see how it goes.

      In the below code I am assuming that MyURLString is a variable declared and set at a upper level of code.
      Dim MyURLString as String
      MyURLString = (wherever this can be found in your code on a page load for the address bar)

      'Code to get a favorite saved
      Private Sub Command1_Click( )
      'Declare variables.
      Dim fso As New FileSystemObjec t
      Dim ts As TextStream
      'Open file.
      Set ts = fso.OpenTextFil e("C:\Windows\M yFile.txt")
      ts.Write(MyURLS tring)
      'Close the file.
      ts.Close
      End Sub
      thanks i'll trying working thought this , first day on vb tho so a little confusing but i'll work it out :) good answer

      Comment

      Working...