Reputation: 43
I need to write an application in C# and VS2010 that can listen to the download event from Internet Explorer and capture the file URL to add it to a certain database.
My only problem is on how to implement an interface that actually captures that event.
What would I need in order to build or implement such functionality?
Looking for functionality as the "Free download manager or FDM software", each time you start a download on Internet Explorer, a "FDM" window pops up containing the URL of the download.
Upvotes: 4
Views: 1718
Reputation: 92
You can use something like this:
public class BHO:IObjectWithSite
{
private WebBrowser webBrowser;
public int SetSite(object site){
webBrowser = (WebBrowser)site;
webBrowser.DownloadComplete +=new DWebBrowserEvents2_DownloadCompleteEventHandler(webBrowser_DownloadComplete);
(...)
}
Upvotes: 0
Reputation: 81660
You need a browser helper object. These are COM components so you can develop them using C# but you need to expose them to COM.
Here is a primer to the COM programming in C#.
It seems the only way it is possible to write browser helper object in C++. Have a look here.
Upvotes: 2