Get Web Page Picture Into your Form Image Box ......
Get Web Page Picture Into your Form Image Box ......
API Declarations
.IO
.Net
.Text
Rate Get Web Page Picture Into your Form Image Box ......
(1(1 Vote))
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'http://www.cnet.co.uk/i/c/blg/cat/digitalmusic/mario_apple.jpg
'http://www.designest.com/img/desktop/1_apple_a_day_1024.jpg
If TextBox1.Text.ToString().Trim().Length = 0 Then _
MessageBox.Show("Set URL Path", "URL Path", MessageBoxButtons.OK, MessageBoxIcon.Error) _
: Exit Sub
Me.Cursor = Cursors.WaitCursor
Dim objmemstream As MemoryStream
Dim objwebclient As WebClient
Dim url As String = TextBox1.Text.ToString().Trim()
If Not url.ToLower().StartsWith("http://") Then
url = "http://" & url
End If
objwebclient = New WebClient()
objmemstream = New MemoryStream(objwebclient.DownloadData(url))
PictureBox1.Image = Bitmap.FromStream(objmemstream)
Me.Cursor = Cursors.Default
End Sub
End Class
Get Web Page Picture Into your Form Image Box ...... Comments
No comments yet — be the first to post one!
Post a Comment