|
-
Mar 25th, 2005, 07:47 PM
#1
Thread Starter
Member
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
-
Mar 26th, 2005, 07:14 AM
#2
Fanatic Member
Re: Detect web adress change using inet ctrls?
I assume you made your own browser with an address combobox??
If so...
VB Code:
Private Sub Combo1_Change()
if combo1.text = "website.com/cgi-bin?mod=secured&234242ib452jhb234" Then
Label1.Caption = "Logged In"
Else
Label1.Caption = ""
End If
End Sub
Is this what you are looking for?
-
Mar 26th, 2005, 02:03 PM
#3
Thread Starter
Member
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!
-
Mar 27th, 2005, 07:25 AM
#4
Fanatic Member
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.
-
Mar 27th, 2005, 08:37 AM
#5
Thread Starter
Member
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.
-
Mar 27th, 2005, 12:55 PM
#6
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|