直接上代码, 紧做记录.
public byte[] GetByteByImgUrl() { System.Net.WebRequest webreq = System.Net.WebRequest.Create(HttpUtility.UrlDecode(form["imgphoto"])); System.Net.WebResponse webres = webreq.GetResponse(); Stream stream = webres.GetResponseStream(); System.Drawing.Image img = System.Drawing.Image.FromStream(stream); MemoryStream ms = new MemoryStream(); img.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); return ms.ToArray(); }