You could also modify this code just a tad to make it a bit more versatile by allowing the option to save the file to disk upon displaying it. I turned it into a function by adjusting a few simple things, like so:
VB Code:
Public Function webDownloadImage(ByVal Url As String, Optional ByVal saveFile As Boolean = False, Optional ByVal location As String = "C:\") As Image
Dim webClient As New System.Net.WebClient
Dim bytes() As Byte = webClient.DownloadData(Url)
Dim stream As New IO.MemoryStream(bytes)
If saveFile Then My.Computer.FileSystem.WriteAllBytes(location, bytes, False)
Return New System.Drawing.Bitmap(stream)
End Function
This way, you can use it as:
VB Code:
PictureBox1.Image = webDownloadImage("http://www.somewebsite.com/image.jpg", True, "C:\temp.jpg")
This will allow you to not only use it as a direct source for an image, but allow you to save the image to your hard drive if you should so choose. Good code, in any case. VERY useful ;D