![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
|
I'm using a webbrowser control on vista to programmatically save files from the web. I'm trying to use the WebBrowser.Document.ExecCommand function with the SaveAs command, as documented in http://msdn2.microsoft.com/en-us/lib...8VS.85%29.aspx [I replaced ( and ) in the URL by %28 and %29 because my news agent doesn't seem to support links with those characters] This results in something like : br2.Document.ExecCommand("SaveAs", False, DownloadPath) This works, but the last two arguments are ignored. The "save as" dialog always pops up even though I tell it not to, and the initial path is in My Documents. I replaced \ by \\ in the path as indicated in the docs, but whether I do or don't doesn't make any difference. Could this be a (security or other) setting in IE, or does IE7/Vista simply not work as documented in MSDN? Or perhaps you can give a hint to help solve my original problem: I had to resort to a WebBrowser because the site where I'm downloading from is secured, and when I use a HTTPWebRequest I get some html code asking me to log on instead of the image, even when I'm already logged on to the site through a webbrowser control in the same app. Using the logon functionality in the HTTPWebRequest doesn't work because the site uses a PHP form for logging on. Using a second WebBrowser instead of a HTTPWebRequest solved that problem, but now I'm stuck on those save dialogs. A lot of work for an application that will be used only once, but the alternative is clicking "save target as" and confirming the download location in a standard web browser hundreds of times. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |