The text of this article is not in this database — only its details are. Read it on the old site: Downloading Web Pages in VB.NET
14 Comments
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
The text of this article is not in this database — only its details are. Read it on the old site: Downloading Web Pages in VB.NET
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
James SumnereditedPosted Dec 28, 2009, 1:08 AMEdited Dec 28, 2009, 5:07 AM
Hey There, Thanks for the example but it throws a few errors I have adapted it to a form appliaction but it works just the same. Hope this helps anyone who had the same problems as I did. 'an example website that will always be there ;D Dim URL As String = "http://www.google.co.nz/" Dim request As HttpWebRequest = WebRequest.Create(URL) Dim response As HttpWebResponse Try response = request.GetResponse() Dim reader As StreamReader = New StreamReader(response.GetResponseStream()) Dim str As String = reader.ReadLine() ' speed up process TextBox1.Text = reader.ReadToEnd 'if error occurs then application doesnt crash Catch MessageBox.Show("Error Getting Webpage") End Try Hope it helps Sumn3rd
Tore ForsgrenPosted Dec 27, 2009, 2:01 AM
The downloaded file may probably contain empty lines. To be sure the entire file is downloaded use: Do While Not reader.EndOfStream Console.WriteLine(reader.ReadLine()) Loop
TeomanPosted Sep 27, 2009, 2:01 PM
Good article but httpwebrequest freezes program.What is the solution?
narini rosliPosted Nov 6, 2008, 4:21 AM
Thanks for sharing. But, just like Ahmad's query, how to i download the file from a protected site. The file that i want to query is an XML file, and the data will be constantly change every few seconds. Can i use the Webclient method to query the XML file in real time , and how do i do it? I would need to key in Login ID and password as well. Thanks. ;)
Ahmad TasnimPosted Sep 2, 2008, 2:19 AM
After login i tried to download the files but i am not able to download. Link at top right is not clickable :(
Ahmad TasnimPosted Sep 2, 2008, 2:17 AM
After login i tried to download the files but i am not able to download. Link at top right is not clickable :(
UnScriptedPosted Jan 22, 2008, 7:15 AM
Your article is good, i want to have a quick question. For suppose i want to login to a site and then download a webpage how can i perform the task.
hardik patelPosted Nov 15, 2007, 12:54 PM
Good article I have files on website in zip format ..I am using webrequest and webresponse .but I want to stored zip files in my local directory..I am not allowed to add any class (open sourse) any idea how to do it??
Paul BarringtoneditedPosted Sep 20, 2007, 11:39 AMEdited Sep 20, 2007, 11:42 AM
Good article, very comprehensive. I cut and paste the code to my IDE. Build is successful, but no output shows on the cmd window when I run it?!?!? Immediate window displays the following: A first chance exception of type 'System.InvalidCastException' occurred in ConsoleApplication1.exe
ff ffPosted Sep 1, 2007, 7:23 PM
Hi! I'm trying all the tips you've post here, but I have an issue. All code works with HTTP sites, but did not work with HTTPS sites. the exception is: the underlying connection was closed: could not establish trust relationship with remote server". Could you please help me? thank you very much for the article!
maria carolinPosted Aug 24, 2006, 2:19 AM
how to download all the web pages of a site once through c# coding .net
maria carolinPosted Aug 24, 2006, 2:18 AM
how to download web pages of a site through c# coding .net