Thank you.
I used HttpWebRequest and HttpWebResponse and it works. But the result
is not consistent. The problem is beating the wits out of me and
appreciate any advise.
When I tried websiteA, I am able to get the download working.
When I tried websiteB, I am unable to get the download working.
The error is
//
An unhandled exception of type 'System.Net.WebException' occurred in
System.dll
Additional information: The underlying connection was closed: An
unexpected error occurred on a receive.
//
If I run the same program at different location (e.g.in my office vs.
at home), at times both websiteA and websiteB works, yet at times only
websiteA works.
I have not have any success in locating the cause of the above error.
Could it be something special about the network at different location?
or what could be the other possible cause? Any pointers are much
appreciated.
Nicholas Paldino [.NET/C# MVP] wrote:
Instead of doing this through the web browser, you should use the
HttpWebRequest and HttpWebResponse classes. They will allow you to download
the content of the site without having to deal with a user interface.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
<ka*****@yahoo.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
Hi,
Please direct me if this is the wrong group to ask.
I'm writing a c# program to visit website and autodownload files that
may be prompted.
For example, I visit http://www.mytestwebsite.com and the page will
prompt with a somefile.csv. I would like my program to autodownload
whatever maybe the file and then parse it for info I'm interested.
My code is
webBrowser.Navigate("http://mytestwebsite.com");
I'm stuck here because after that, the browser will pop out a window to
ask to save the file. How to make the poping of window go away
automatically and directly store and parse the file?
A million thanks.