Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 3rd, 2007, 08:32 AM
Registered User
 
Join Date: Nov 2007
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Some doubts about WebBrowser Control

hi,
 My first post :).
 I am working on an application, which has a webbrowser control on one of the forms. The user is directed to a web address. If the user downloads a file from there(.zip,.rar), a "Save file" dialog(same as that of IE) pops up. I want the total information about the download in my application, and not this pop-up window. I am not using HTTPWebRequest due to a simple reason that I am not sure of the URL of the download.
 I was successful in showing the progress via ProgressChange event, when the user browses the webpages, but during the download(i.e the pop-up window), the progress is unknown.How can i avoid that pop-up and instead show everydetail in the application?Also save the file to a pre-specified location,I have already tried Webclient class.
Any help appreciated :)

  #2 (permalink)  
Old November 3rd, 2007, 11:08 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

It is doable, but I suspect you will have to inject some events into the web browser to capture each click. See the beow link for details about hookinh up a webbrowser control and client code.

http://msdn2.microsoft.com/en-us/library/a0746166(VS.80).aspx

/- Sam Judson : Wrox Technical Editor -/
  #3 (permalink)  
Old November 3rd, 2007, 09:42 PM
Registered User
 
Join Date: Nov 2007
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Sam,
 I saw the link. The things that they have shown, i.e invoking scripts etc., I have been using them all along and i dont get it how it will help in solving my problem? I have tried all the things that I know, or could find through google. If someone could explain the processes or events that leads to the pop-up "Save File" dialog in a webBrowser, it might be a li'l easier for me to think in a correct direction.
Thanks.

  #4 (permalink)  
Old November 5th, 2007, 10:47 AM
Registered User
 
Join Date: Nov 2007
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, i think i have made some progress.. i found this, and it is exactly what I need to make.

http://msdn2.microsoft.com/en-us/library/aa753618.aspx

But I am not sure how to proceed.. due lack of example , I am clueless!
can someone help me?

  #5 (permalink)  
Old November 5th, 2007, 11:31 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

How about looping through each HtmlElement returned by webBrowser.Document.GetElementByTagName("a") and handling the Click event.

Then in the Click event handler check the href attribute. If it is the file you want then do the download manually and set e.ReturnValue to false, otherwise set it to true.

/- Sam Judson : Wrox Technical Editor -/
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Webbrowser control mussie C# 2005 1 March 2nd, 2010 01:10 PM
Loading HTML into WebBrowser control osemollie Pro VB Databases 7 August 17th, 2006 03:12 PM
Implement of Interface of webbrowser control vickyj Visual C++ 0 January 18th, 2006 07:15 AM
change page encoding in WebBrowser ActiveX control alexxx_ltd Visual C++ 2 December 16th, 2004 07:08 PM
WebBrowser control atingoldy Beginning VB 6 1 June 16th, 2003 06:00 AM



All times are GMT -4. The time now is 05:36 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.