-
Jul 5th, 2018, 05:59 AM
#1
Thread Starter
Member
How can I read what is being searched in a web browser, and return it to a MessageBox
I have an application which I'm using to practice with, which will re-direct traffic from a certain website to a different website.
1.
User opens a web-browser and types in a link like "www.youtube.com".
2.
The user presses 'enter' and they're forwarded to www.youtube.com.
Now, what if I don't want to go to this website, and I want to redirect the search to a different domain? How would I do this? Would it look something like this?
Code:
Dim website As "www.youtube.com"
If website.IsSearched = True Then
MesssageBox.Show("This site is whitelisted.")
I know this code will NOT work, but, it's a brief example of what I'm trying to achieve.
Any help or references to projects would be great.
-
Jul 5th, 2018, 06:15 AM
#2
Re: How can I read what is being searched in a web browser, and return it to a Messag
Are you talking about a Windows Forms WebBrowser control? If so then I think what you're looking for is the Navigating event. You can test e.Url, set e.Cancel to True to cancel the current navigation and then call Navigate and pass an alternative URL if desired.
-
Jul 5th, 2018, 06:16 AM
#3
Thread Starter
Member
Re: How can I read what is being searched in a web browser, and return it to a Messag
No.
I'm looking to read what the user types into the browser, and if the user types in a certain link, the redirect event will happen. I'm not using WebBrowser.
-
Jul 5th, 2018, 06:22 AM
#4
Re: How can I read what is being searched in a web browser, and return it to a Messag
So you're talking about any web browser application, e.g. IE, Chrome, Firefox of Edge? That's probably relevant information that you should include in your OP. Clarity is never bad.
-
Jul 5th, 2018, 06:22 AM
#5
Thread Starter
Member
Re: How can I read what is being searched in a web browser, and return it to a Messag
-
Jul 5th, 2018, 07:50 AM
#6
Re: How can I read what is being searched in a web browser, and return it to a Messag
Sounds like he wants a keylogger
-
Jul 5th, 2018, 04:36 PM
#7
Re: How can I read what is being searched in a web browser, and return it to a Messag
The short story is you cannot do what you are asking. You would be better off managing the local HOSTS file than reinventing the wheel.
Tags for this Thread
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
|