Hi everone.
I need to find a way to get the URL from a link that has been clicked
on a website so that I can compare it to a URL on a safe list I have.
I'm using C# Browser control, and I have a LinkClick event handler. I
just don't know how to get the actual URL out of it. Can someone please
help? Thanks.
Loading

Kirtan PatelRank #292 · 8.6K reputationPosted Sep 15, 2009, 6:22 PM EDT
please dont forget to mark "Do you like answer" it will give me some credits :)
private void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e)
{
//Show Captured URL In msg Box
MessageBox.Show("Captured URL :" + e.Url.ToString());
}
Bryan108 reputationPosted Sep 15, 2009, 8:10 AM EDT
I didn't see the part to get the link URL. Do you think you could point me in a more specific location for it? Thank you.
Master BillaRank #2,229 · 630 reputationPosted Sep 15, 2009, 6:45 PM EDT
You can use the navigating event to this to get url when you are click the hyper link in your web broswer control
private void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e)
{
string currentURl= e.Url.ToString());
}
thank you
Kirtan PatelRank #292 · 8.6K reputationPosted Sep 15, 2009, 6:52 PM EDT
you can see i have told the same Why you repeating Code ?