Response.BinaryWrite 输出的gif图片为什么不动?
1 Uri myUri = new Uri(imgUrl); 2 WebRequest webRequest = WebRequest.Create(myUri); 3 WebResponse webResponse = webRequest.GetResponse(); 4 Bitmap myImage = new Bitmap(webResponse.GetResponseStream()); 5 6 MemoryStream ms = new MemoryStream(); 7 8 myImage.Save(ms, System.Drawing.Imaging.ImageFormat.Gif) 9 Response.ClearContent(); 10 Response.ContentType = "image/Gif"; 11 Response.BinaryWrite(ms.ToArray());
不要用BITMAP接受数据
那用什么?