[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.8

VB .Net - trouble automating download of a file using urldownloadtofile

Asked by lcha in Microsoft Visual Basic.Net, Microsoft Programming, .NET

Tags: VB .Net automate download file

Hello,

I need assistance to programatically download a file.   I've written a VB .Net program that uses the webbrowser control to navigate and log in to a website, It navigates through a couple web pages on the site and the clicks on a hyperlink to download a file.  

The file is an .exe file which generates a report that I need to download.   When the program clicks this link, it receives a series of different popups windows (see attachment)

PLEASE see attachment PAGE 5 & 6.  
PAGES 1-4 show the full flow but 5 - 6 are most relevant to this question    

I tried using the following API -  urldownloadtofile but it doesn't seem to work.
As I debug throught the code to execute this method nothing happens.    Note, I used the webbrowser object to login and navigate to the point to click the link to download the file.    

Considering, you can't just go to the url I specified in the urldownloadtofile method .... you need to login and enter password before downloading anything from the site - Do I need to associate the web browser object somehow with the URLDownloadtoFile method?

With the issue described, what is the best and easiest method for downloading and running this file?

Any insight or guidance will be much appreciated.    thanks!
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
http://support.microsoft.com/default.aspx?scid=kb;en-us;244757
 
The WebBrowser control and Internet Explorer have Save and Save As options that can be used to save files using the ExecWB command. However, this involves prompting from the user. There is no way to suppress this prompt. To save files to the hard-disk without prompting, use the URLDownloadToFile API from URLMON.
 
Private Declare Function URLDownloadToFile Lib "urlmon" _
    Alias "URLDownloadToFileA" (ByVal pCaller As Long, _
    ByVal szURL As String, ByVal szFileName As String, _
    ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
 
 
 URLDownloadToFile(0, "http://(removed by ModernMatt).com/user/u_report_giver.asp?Report=f_iv200907.exe", "C:\f_iv200907.exe", 0, 0)
Attachments:
 
the full picture / flow - from start to finish.
 
[+][-]08/25/09 12:57 AM, ID: 25175280Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Microsoft Visual Basic.Net, Microsoft Programming, .NET
Tags: VB .Net automate download file
Sign Up Now!
Solution Provided By: CodeCruiser
Participating Experts: 1
Solution Grade: A
 
[+][-]08/21/09 04:03 PM, ID: 25156616Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/23/09 05:04 PM, ID: 25164855Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/24/09 07:02 AM, ID: 25168383Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/24/09 12:08 PM, ID: 25171369Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/24/09 01:30 PM, ID: 25172255Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/24/09 02:17 PM, ID: 25172722Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/24/09 06:23 PM, ID: 25173965Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/25/09 11:20 AM, ID: 25180538Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 - Hierarchy / EE_QW_3_20080625