Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Controls / December 2007

Tip: Looking for answers? Try searching our database.

Suppress Save Dialog in WebBrowser control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
anand gothe - 28 Dec 2007 12:08 GMT
Hi,

I'm using the WebBrowser control (.NET 2.0) to login to a website and
download a file. I navigate to the login page of the website, then
programatically fill username and password to login. Then I navigate to the
URL of the file. It all works fine, but I get the IE Save Dialog box when I
navigate to the file URL.

Is there a way to suppress this Save Dialog and instead download the file to
a given location.

I know the WebClient class has a DownloadFile method, but I need to be
logged-in to the website in order to download (i.e need to have a valid
session). I don't think the WebClient or WebRequest will allow me to access
the home page and login before accessing the URL for the file.

Could you help?

- &
Sheng Jiang[MVP] - 28 Dec 2007 19:58 GMT
You can use WebClient or WebRequest to make multiple requests with the same
cookie container
To enable WebClient to use a cookie container you need to override the
GetWebRequest method, create a request that reuses the cookie container
between requests.

Signature

Sheng Jiang
Microsoft MVP in VC++

> Hi,
>
[quoted text clipped - 15 lines]
>
> - &

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.