Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click PictureBox1.Image = Nothing If File.Exists(Environment.CurrentDirectory & "\TEMPS\A") Then Try File.Delete(Environment.CurrentDirectory & "\TEMPS\A") Catch ex As Exception MsgBox(ex.Message.ToString, MsgBoxStyle.DefaultButton1, "Delete File") Exit Sub End Try End If Try My.Computer.Network.DownloadFile(Lien.Text, Environment.CurrentDirectory & "\TEMPS\A") PictureBox1.Image = Image.FromFile(Environment.CurrentDirectory & "\TEMPS\A") Catch ex As Exception MsgBox(ex.Message.ToString, MsgBoxStyle.DefaultButton1, "DownloadFile") End Try End Sub
Dim fs As New IO.FileStream("image.png", IO.FileMode.Open) PictureBox1.Image = Image.FromStream(fs) fs.Close()
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question