am trying to display an image in a "toolStrip" i c# from a weburl. Am using the following methode to get the image
WebRequest requestPic5 = WebRequest.Create(icon_path);
requestPic5.Timeout = 5000;
WebResponse responsePic5 = null;
Image Myimg5 = null;
if (requestPic5 != null)
{
responsePic5 = requestPic5.GetResponse();
if (responsePic5 != null)
{
Myimg5 = Image.FromStream(responsePic5.GetResponseStream());
}
}
its failing when Myimg5 = Image.FromStream(responsePic5.GetResponseStream()); throws an exception but the image is still there in the url
But unfortunately most of the time its not loading properly and sometimes throwing a 404 error