Click here to Skip to main content
15,886,873 members
Home / Discussions / C#
   

C#

 
QuestionWhile editing a cell that is newly created in GridView throws Index out of range error Pin
vytheese4-May-08 23:19
professionalvytheese4-May-08 23:19 
AnswerRe: While editing a cell that is newly created in GridView throws Index out of range error Pin
Luc Pattyn4-May-08 23:33
sitebuilderLuc Pattyn4-May-08 23:33 
GeneralRe: While editing a cell that is newly created in GridView throws Index out of range error Pin
vytheese5-May-08 0:13
professionalvytheese5-May-08 0:13 
QuestionProblem with Modal Form Pin
MehmetFurkan4-May-08 22:21
MehmetFurkan4-May-08 22:21 
AnswerRe: Problem with Modal Form Pin
Anindya Chatterjee4-May-08 22:39
Anindya Chatterjee4-May-08 22:39 
AnswerRe: Problem with Modal Form Pin
Luc Pattyn4-May-08 23:14
sitebuilderLuc Pattyn4-May-08 23:14 
QuestionException : RowNotInTableException was unhandled by user code Pin
cocoonwls4-May-08 22:04
cocoonwls4-May-08 22:04 
QuestionHow to intercept Rapidshare file download in WebBrowser control? Pin
Anindya Chatterjee4-May-08 21:39
Anindya Chatterjee4-May-08 21:39 
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: How to intercept Rapidshare file download in WebBrowser control? Pin
Vikram A Punathambekar4-May-08 23:14
Vikram A Punathambekar4-May-08 23:14 
GeneralRe: How to intercept Rapidshare file download in WebBrowser control? Pin
Anindya Chatterjee4-May-08 23:36
Anindya Chatterjee4-May-08 23:36 
GeneralRe: How to intercept Rapidshare file download in WebBrowser control? Pin
Vikram A Punathambekar5-May-08 0:07
Vikram A Punathambekar5-May-08 0:07 
QuestionThis application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. Pin
Member 39190494-May-08 21:05
Member 39190494-May-08 21:05 
AnswerRe: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. Pin
Christian Graus4-May-08 21:10
protectorChristian Graus4-May-08 21:10 
GeneralRe: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. Pin
Member 39190494-May-08 21:33
Member 39190494-May-08 21:33 
GeneralRe: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. Pin
Christian Graus4-May-08 22:55
protectorChristian Graus4-May-08 22:55 
GeneralRe: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. Pin
S. Senthil Kumar5-May-08 4:40
S. Senthil Kumar5-May-08 4:40 
GeneralRe: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. Pin
Member 39190495-May-08 17:00
Member 39190495-May-08 17:00 
GeneralRe: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. [modified] Pin
Member 39190495-May-08 17:31
Member 39190495-May-08 17:31 
GeneralRe: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. Pin
S. Senthil Kumar5-May-08 20:30
S. Senthil Kumar5-May-08 20:30 
GeneralRe: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. Pin
Member 39190496-May-08 21:13
Member 39190496-May-08 21:13 
GeneralRe: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. Pin
Member 391904915-May-08 7:31
Member 391904915-May-08 7:31 
GeneralRe: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. Pin
S. Senthil Kumar15-May-08 17:02
S. Senthil Kumar15-May-08 17:02 
Questionwhich one is smaller n pow 2, 1000 pow n, n pow n, n pow 1000 , when n value is nearer to infinite Pin
huma satti4-May-08 20:57
huma satti4-May-08 20:57 
AnswerDouble Post - Please Ignore Pin
Giorgi Dalakishvili4-May-08 21:05
mentorGiorgi Dalakishvili4-May-08 21:05 
AnswerRe: which one is smaller n pow 2, 1000 pow n, n pow n, n pow 1000 , when n value is nearer to infinite Pin
Christian Graus4-May-08 21:09
protectorChristian Graus4-May-08 21:09 

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.