Torna al Thread

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
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5