Qazek Posted December 4, 2013 Author Share Posted December 4, 2013 Hello!I need help with one small mod for my game. I added Microsoft Internet Controler and now I need a modification wich could check websites on my in game web browser.I tried to do something like that:```WebBrowser.Navigate = "www.google.com" <– website open buttonIf WebBrowser.Navigate = "www.google.com" Then <--- here is a problem because it can't check itlabel.caption = "OK"elselabel.caption = "Only google page!!!"end if``` Link to comment Share on other sites More sharing options...
Growlith1223 Posted December 4, 2013 Share Posted December 4, 2013 ```If webbrowser.Location = "www.google.com" Then' code'End If```i might be wrong on Location(too used to vb.net) Link to comment Share on other sites More sharing options...
jcsnider Posted December 4, 2013 Share Posted December 4, 2013 I "think" you can use webbrowser.navigate("www.google.com") or .navigateToI am just very unaccustomed to web browser controls XD Link to comment Share on other sites More sharing options...
Growlith1223 Posted December 4, 2013 Share Posted December 4, 2013 he's checking if this site = google. not navigate to it :P Link to comment Share on other sites More sharing options...
jcsnider Posted December 4, 2013 Share Posted December 4, 2013 Ok, my bad XD but if you navigate to it then you don't need to check :D Link to comment Share on other sites More sharing options...
Richy420Rich Posted December 4, 2013 Share Posted December 4, 2013 Grow is close;```If WebBrowser.LocationName = "www.google.com" Then```Though VB6 string checking is sensitive, don't forget adding http:// or in some cases, I've even seen https:// Link to comment Share on other sites More sharing options...
Qazek Posted December 4, 2013 Author Share Posted December 4, 2013 Ok thank you all for answers. I found one bug with web adress - i need to use http:// and / at end. But it only works on google site:So this is my google code:```Private Sub Command1_Click()web.Navigate "http://www.google.com/" 'here I can use any adresssite.Caption = web.LocationURLEnd SubPrivate Sub Command2_Click()If web.LocationURL = "http://www.google.com/" Then 'but here adress must have http:// and at the end /text.Caption = "Wszystko dziala ok! / OK' it's work"Elsetext.Caption = "Nie ma tej strony / Bad site"End IfEnd Sub```And here is code of my game site:```Private Sub Command1_Click()web.Navigate "http://www.diamond.ugu.pl/" 'open itsite.Caption = web.LocationURL 'label "site" captionEnd SubPrivate Sub Command2_Click()If web.LocationName = "http://www.diamond.ugu.pl/" Then 'text.Caption = "Wszystko dziala ok!/ Ok, it works"Elsetext.Caption = "Nie ma tej strony/something is wrong"End IfEnd Sub```Only adress difference but with my website doesn't work Link to comment Share on other sites More sharing options...
Richy420Rich Posted December 4, 2013 Share Posted December 4, 2013 Then you already knew how to check website strings Lol..If google's worked, it's because you used: web.LocationURLSo try using web.LocationURL for yours also. Link to comment Share on other sites More sharing options...
Qazek Posted December 4, 2013 Author Share Posted December 4, 2013 Ok I solved it. Sorry but I posted wrong code XD But i need just to check everything in web adress, on my site adress "[http://diamond.ugu.pl/](http://diamond.ugu.pl/)" works perfectly but "http://www.diamond.ugu.pl/" (which i choose in web.navigate) doesn't work XD Sorry for all of that mistakes and thank you :) Link to comment Share on other sites More sharing options...
Growlith1223 Posted December 4, 2013 Share Posted December 4, 2013 because you already have a prefix which is "diamond" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now