.net core get image from url
public System.Drawing.Image DownloadImageFromUrl(string imageUrl){ System.Drawing.Image image = null; try { System.Net.HttpWebRequest webRequest = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(imageUrl); webRequest.AllowWriteStreamBuffering = true; webRequest.Timeout = 30000; System.Net.WebResponse webResponse = webRequest.GetResponse(); System.IO.Stream stream = webResponse.GetResponseStream(); image = System.Drawing.Image.FromStream(stream); webResponse.Close(); } catch (Exception ex) { return null; } return image;}
Also in C#:
- covert char[] to string C#
- how to get component in unity c#
- how to draw a dot in c#
- singleton design pattern c# volatile
- unity movement on forward
- c# webcam
- double tryparse dot comma
- lat long data type c#
- initialize matrix c#
- unity make a int arry with preset values
- c# new list object
- c# textbox tab column
- non null array length
- split string in c#
- .net core get image from url
- call stored proc c#
- devexpress objectspace to session
- c# anonymous class
- c# string replace comma with newline
- asp.net core mvc not triggering client side validation
- check which activity in focus in android
- percentage in c#
- How to get the world position of the edge of an object?
- csharp first element of array