0

Possible Duplicate:
How to get the URL of the current page in C#

I want to develop an application which stores users browsing history in real time while my application running in background.

e.g While my application running in background if user types url in chrome or firefox .. i want to store that url in database

how to do that in C#?

Community
  • 1
  • 1
omkar patade
  • 1,442
  • 9
  • 34
  • 66
  • **http://stackoverflow.com/questions/593709/how-to-get-the-url-of-the-current-page-in-c-sharp** – huMpty duMpty Oct 26 '12 at 09:01
  • I don't think you can do that from WPF, you need to develop plugins for FF and Chrome that will send the url to your background app. – Stefan P. Oct 26 '12 at 09:04
  • [FiddlerCore](http://www.fiddler2.com/fiddler/Core/) – L.B Oct 26 '12 at 09:04
  • You can probably use `FindWindow` and similar functions. But you'll need to add support for each browser separately, and it can break with browser upgrades. – CodesInChaos Oct 26 '12 at 09:19
  • I'm thinking that outgoing packet sniffing is the way to go. But one will probably be stumped on https queries. – WozzeC Oct 26 '12 at 09:28

1 Answers1

0

I can't give you exact code, but I would consider looking at L.B's suggestion.

Look at: http://www.fiddler2.com/fiddler/Core/

If you haven't tried Fiddler, try to install it. Then you will notice it intercepts all requests made by you, and also the URL's.

By looking at how Fiddler works (see the link above), you can parse all URL's which are requested. That's probably both the easiest and best way.

I haven't done it before, but I would guess you would have to search for "Listening to Port 80" or alike. You would have to look at all traffic from that port.

Lars Holdgaard
  • 9,496
  • 26
  • 102
  • 182