Hey guys/gals I have an app where I want to be able to view an image into a picture box by entering the URL of the image.
I keep get error of:
Here is my code:
Any idea on why this doesn't work?Code:Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim request As Net.HttpWebRequest = DirectCast(Net.HttpWebRequest.Create("http://www.google.com/imgres?q=how+to+make+pizza&um=1&hl=en&sa=N&biw=1152&bih=662&tbm=isch&tbnid=wPjdN6FblAIplM:&imgrefurl=http://italianfood.about.com/od/breadspizza/ss/pizzaovn_2.htm&docid=6hmsagY8r4juxM&imgurl=http://0.tqn.com/d/italianfood/1/0/9/E/doughbls.jpg&w=400&h=300&ei=VSmgTua3FMPk0QH4uN20BA&zoom=1&iact=rc&dur=31&sig=115939356797183712562&page=1&tbnh=132&tbnw=177&start=0&ndsp=15&ved=1t:429,r:3,s:0&tx=60&ty=129"), Net.HttpWebRequest) Dim response As Net.HttpWebResponse = DirectCast(request.GetResponse, Net.HttpWebResponse) Dim img As Image = Image.FromStream(response.GetResponseStream()) response.Close() PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage PictureBox1.Image = img End Sub End Class
If I use this address it works but nothing else....
http://www.google.co.uk/intl/en_uk/images/logo.gif





Reply With Quote