简体   繁体   中英

Download Manager for Internet Explorer in C#

I want to override internet explorer download manager function. I've managed to implement IDownloadManager interface in c# and registered COM, so that i can catch the download event and perform custom action. I also have existing download manager application.

My concern is whether the IDownloadManager implementation should be part of my application or rather separate project that only communicates with my download manager. I would preffer one application approach, but I don't konw how should be implemented.

The main problem I see is that I want to have only one instance of download manager running, so from the COM code I should probably:

1) check whether the instance is already running(using GetWindow from winapi?), if not then start it.

2) pass the download url to the instance.

This should work but I'm unexperienced with winapi and i suspect there might be a better way to do this. Any hints? Thansk, Matt

You should use the out-of-process COM server helpers . COM infrastructure will then take care of proper process management, including serve lock and correct shutdown sequence (something you cannot get right on your own, w/o COM's help).

Simply passing a download URL to a different application will often work, but there are many cases that will not work with an architecture that simple. In particular, sites that require particular cookies or authentication information will typically fail without this information, and re-starting a download in another application may result in the server rejecting the connection (some sites refuse to allow multiple connections).

Generally speaking, you should avoid using .NET to build Internet Explorer extensions because doing so has performance and reliability problems. (If you must use .NET, you should try to use .NET4, which does not suffer from the side-by-side versioning problem that earlier versions of the CLR have).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM