Results 1 to 6 of 6

Thread: Detect web adress change using inet ctrls?

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2004
    Location
    Paris Onatrio, Canada
    Posts
    44

    Detect web adress change using inet ctrls?

    Greetings.
    I am having some trouble finding an example of how to detect if my program's inet browser box make's a change in adresses.
    For example:
    The program will know when the user logs in because the adress will change to:
    website.com/cgi-bin?mod=secured&234242ib452jhb234
    Something like that.
    Then, I want to display a label telling the user they are logged in.
    If you know how to accomplish this, or can point me in the right direction, i would be greatly appreciative :P
    Thanks all
    HaLA oWNS J00!

  2. #2
    Fanatic Member
    Join Date
    Oct 2003
    Posts
    1,005

    Re: Detect web adress change using inet ctrls?

    I assume you made your own browser with an address combobox??

    If so...

    VB Code:
    1. Private Sub Combo1_Change()
    2.     if combo1.text = "website.com/cgi-bin?mod=secured&234242ib452jhb234" Then
    3.         Label1.Caption = "Logged In"
    4.     Else
    5.         Label1.Caption = ""
    6.     End If
    7. End Sub
    Is this what you are looking for?

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2004
    Location
    Paris Onatrio, Canada
    Posts
    44

    Re: Detect web adress change using inet ctrls?

    Well, The user just hits the login button from the website (in the inet box)
    then I want to see if he logs in correctly by detecting a change...
    So:
    if website.com/login changes to website.com/loggedin.asp
    then it would alert the user he is "logged in"
    Though, On the website there is a bunch of random secure digets, How would I add a wildcard to detect that.. so like website.com/loggedin.asp*
    Last edited by Halazonia; Mar 26th, 2005 at 02:07 PM.
    HaLA oWNS J00!

  4. #4
    Fanatic Member
    Join Date
    Oct 2003
    Posts
    1,005

    Re: Detect web adress change using inet ctrls?

    Not sure if you will be able to use a wilder card, because to evaluate a string you have to know what you are looking for... exact characters.

    Maybe you could just use the "Left" command to do this...

    Dim MyString As String
    MyString = Left("http://www.website.com/loggedin.asp ???????", 34)

    If MyString = "http://www.website.com/loggedin.asp" then
    label.caption = "LOGGED IN"
    End If

    Using LEFT() will only return all the characters you are sure will always be there. "34" is the number of char to get from the string.

    Don't know if that will help you in this case or not.

  5. #5

    Thread Starter
    Member
    Join Date
    Jan 2004
    Location
    Paris Onatrio, Canada
    Posts
    44

    Re: Detect web adress change using inet ctrls?

    Thank you, That last chunk of code seems alot simpler than the 'wildcard' approach I was taking. Though, That is still rendered useless untill I find out how to see which adress the browser is currently at.
    HaLA oWNS J00!

  6. #6
    Fanatic Member
    Join Date
    Oct 2003
    Posts
    1,005

    Re: Detect web adress change using inet ctrls?

    When combo box gets the focus, just get the address first by using a global variable. Then when its changes you will have the first and the one it changed to.

    In a module type...
    Dim FirstStr As String

    In the combo GetFocus event put...

    FirstStr = Combo1.Text

    Then in the Change event do the code like we discussed above.
    You will be able to evaluate both strings in the change event.

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