Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi How can i change default download from google chrome to my program in c#?
for example if you click the links in google chrome, it will send the link to my program
how can i do it?
Best Regards
Posted
Comments
BillWoodruff 21-Nov-14 12:24pm    
And, your program (WinForms ? WPF ?) is doing what at the time a Chrome download is triggered ?
Avenger1 21-Nov-14 12:26pm    
i using winForms
and when you click the download link, don't download with chrome download with my program

I purchased Internet Download Manager several years ago, and it has been updated many, many, times as browsers have evolved/changed. IDM is able to intercept most, but not all, download activities from within Chrome when you set the IDM preferences to integrate IDM into Chrome.

The fact that IDM is frequently updated just to deal with Chrome integration, and the fact that IDM has user-preferences for selecting integration with any/all of seven different browsers, suggests that hooking Chrome at a low-level is probably a major technical accomplishment, and may require frequent updates of your code if you are able to hook into it.

As an alternative, how about setting the browser default download path to a special folder you create which your application has created a FileSystemWatcher to monitor, and then detecting the addition of the downloaded file ?

For example, see John Simmons' two-part CP series on FileSystemWatcher: [^].
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 21-Nov-14 13:16pm    
Even though this is good information and I up-voted the answer, it does not address what OP wanted (I would rather say, though that he wanted :-). Please see my answer.
And I don't like your idea of using FileSystemWatcher. By the way, pay attention: John's articles describe problems of these class...
—SA
BillWoodruff 21-Nov-14 13:19pm    
I appreciate your vote, Sergey.
Avenger1 21-Nov-14 14:13pm    
BillWoodruff can you tell me
why IDM can be default download application in some browsers?
and why i can't?
Best Regards
Maciej Los 21-Nov-14 15:31pm    
+5
This is a wrong idea. Are you going to enforce the way the user downloads by your application? You should not do that. The user know better what default downloader to use. If you could do what you want, it would be way too intrusive.

Instead, if you have your own downloaded, you should not "attack" a default browser, but can simply embed your own downloader in your own application, not touching any available browsers at all. You cannot even assume that the user has Chrome or even knows what is that.

And if you wanted to capture downloading just for yourself, for your own copy of Chrome, it would not be a programming question.

—SA
 
Share this answer
 
Comments
Avenger1 21-Nov-14 13:19pm    
why IDM can be default download application in some browsers?
and why i can't?
please explain me more
Best Regards
Sergey Alexandrovich Kryukov 21-Nov-14 13:57pm    
Ask Bill about IDM by commenting on Solution 1.
I answered what you probably really want to do: don't touch any browsers and their functionality.
—SA
Avenger1 21-Nov-14 14:12pm    
i want to download file from internet by my program and i want it send all download automatically to my program
Sergey Alexandrovich Kryukov 21-Nov-14 14:43pm    
Don't do it in browser. Download it by your application. This is way to simple, just few lines of code. If you have you own downloader, you should know that. What's the problem?
—SA
Maciej Los 21-Nov-14 15:32pm    
+5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900