Click here to Skip to main content
15,887,135 members
Home / Discussions / C#
   

C#

 
AnswerRe: Windows Service - Service Thread Not Starting Pin
PIEBALDconsult6-May-08 13:45
mvePIEBALDconsult6-May-08 13:45 
GeneralRe: Windows Service - Service Thread Not Starting Pin
ooten147-May-08 9:16
ooten147-May-08 9:16 
GeneralRe: Windows Service - Service Thread Not Starting Pin
PIEBALDconsult7-May-08 13:07
mvePIEBALDconsult7-May-08 13:07 
QuestionA problem unloading Application Domains Pin
Togakangaroo6-May-08 8:30
Togakangaroo6-May-08 8:30 
AnswerRe: A problem unloading Application Domains Pin
Togakangaroo7-May-08 8:11
Togakangaroo7-May-08 8:11 
QuestionHow to make chm file help in windows application? Pin
Eng Mohammed Osman6-May-08 7:58
Eng Mohammed Osman6-May-08 7:58 
AnswerRe: How to make chm file help in windows application? Pin
Thomas Stockwell6-May-08 8:10
professionalThomas Stockwell6-May-08 8:10 
QuestionStill Stuck: How to intercept rapidshare download in WebBrowser control using Http POST Pin
Anindya Chatterjee6-May-08 7:03
Anindya Chatterjee6-May-08 7:03 
I am developing a C# app which will download Rapidshare files for Free users. The program would work as follows:



1. Rapidshare webpage would open in WebBrowser control.

2. Captcha would be input in the webpage

3. File download will occur using the download manager of the app, instead of the default download manager.



I have designed the download section in the following way.


<br />
private void rapidWebBrowser_Navigating(object sender, WebBrowserNavigatingEventArgs e)<br />
<br />
{<br />
<br />
string filename = @"C:\test.rar";<br />
<br />
Regex pattern = new Regex(@"http://([0-9a-zA-Z]+)\.rapidshare\.(com|de)/files/([0-9]+)/([0-9]+)/([^\r\n]+)", RegexOptions.IgnoreCase);<br />
<br />
string match = e.Url.AbsoluteUri;<br />
<br />
if (pattern.IsMatch(match))<br />
<br />
{<br />
<br />
e.Cancel = true;<br />
<br />
WebClient client = new WebClient();<br />
<br />
Uri uri = new Uri(match);<br />
<br />
client.DownloadFileAsync(uri, filename);<br />
<br />
}<br />
<br />
}<br />
<br />


While running, the app downloads a 10KB file instead of the real one. If I use the followsing code:


<br />
private void rapidWebBrowser_FileDownload(object sender, EventArgs e)<br />
<br />
{<br />
<br />
Regex pattern = new Regex(@"http://([0-9a-zA-Z]+)\.rapidshare\.(com|de)/files/([0-9]+)/([0-9]+)/([^\r\n]+)", RegexOptions.IgnoreCase);<br />
<br />
if (pattern.IsMatch(match)) // match is assigned to the required navigating url<br />
<br />
{ <br />
<br />
WebClient client = new WebClient();<br />
<br />
Uri uri = new Uri(match);<br />
<br />
client.DownloadFileAsync(uri, filename);<br />
<br />
}<br />
<br />
}<br />
<br />


the app downloads a 10KB file and pops up IE's default download manager.



How to solve the problem? I want to intercept the original file download by WebBrowser control, and pass the url to my app's custom downloader suppressing the IE's downloader. How to do this?



I am eagerly waiting for the solution. Thank you in advance.

Anindya Chatterjee

AnswerRe: Still Stuck: How to intercept rapidshare download in WebBrowser control using Http POST Pin
led mike6-May-08 8:19
led mike6-May-08 8:19 
GeneralRe: Still Stuck: How to intercept rapidshare download in WebBrowser control using Http POST Pin
Anindya Chatterjee6-May-08 10:36
Anindya Chatterjee6-May-08 10:36 
GeneralRe: Still Stuck: How to intercept rapidshare download in WebBrowser control using Http POST Pin
led mike6-May-08 11:40
led mike6-May-08 11:40 
GeneralRe: Still Stuck: How to intercept rapidshare download in WebBrowser control using Http POST Pin
Anindya Chatterjee6-May-08 17:51
Anindya Chatterjee6-May-08 17:51 
AnswerRe: Still Stuck: How to intercept rapidshare download in WebBrowser control using Http POST Pin
Spacix One7-May-08 2:34
Spacix One7-May-08 2:34 
GeneralRe: Still Stuck: How to intercept rapidshare download in WebBrowser control using Http POST Pin
Anindya Chatterjee7-May-08 2:38
Anindya Chatterjee7-May-08 2:38 
GeneralRe: Still Stuck: How to intercept rapidshare download in WebBrowser control using Http POST Pin
Spacix One7-May-08 2:47
Spacix One7-May-08 2:47 
RantRe: Still Stuck: How to intercept rapidshare download in WebBrowser control using Http POST Pin
Spacix One6-May-08 10:16
Spacix One6-May-08 10:16 
JokeRe: Still Stuck: How to intercept rapidshare download in WebBrowser control using Http POST Pin
That Asian Guy6-May-08 11:02
That Asian Guy6-May-08 11:02 
GeneralRe: Still Stuck: How to intercept rapidshare download in WebBrowser control using Http POST Pin
Anthony Mushrow6-May-08 11:22
professionalAnthony Mushrow6-May-08 11:22 
RantRe: Still Stuck: How to intercept rapidshare download in WebBrowser control using Http POST Pin
Spacix One6-May-08 11:30
Spacix One6-May-08 11:30 
GeneralRe: Still Stuck: How to intercept rapidshare download in WebBrowser control using Http POST Pin
led mike6-May-08 11:36
led mike6-May-08 11:36 
JokeRe: Still Stuck: How to intercept rapidshare download in WebBrowser control using Http POST Pin
Spacix One7-May-08 2:37
Spacix One7-May-08 2:37 
QuestionWatiN and VS 2008 Pin
Drew19846-May-08 6:18
Drew19846-May-08 6:18 
QuestionException Logging Application Block - Not Releasing File [modified] Pin
Tristan Rhodes6-May-08 5:44
Tristan Rhodes6-May-08 5:44 
AnswerRe: Exception Logging Application Block - Not Releasing File Pin
tgrt6-May-08 7:17
tgrt6-May-08 7:17 
GeneralRe: Exception Logging Application Block - Not Releasing File Pin
Tristan Rhodes6-May-08 22:42
Tristan Rhodes6-May-08 22:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.