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.
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.
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.
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.
Re: How can I read what is being searched in a web browser, and return it to a Messag
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
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.