62,074
社区成员
发帖
与我相关
我的任务
分享
[WebMethod]
public byte[] ToByte(String Url)
{
MemoryStream Ms = new MemoryStream();
WebRequest Wr = WebRequest.Create(Url);
WebResponse Res = Wr.GetResponse();
Bitmap bp = new Bitmap(Res.GetResponseStream());
bp.Save(Ms, System.Drawing.Imaging.ImageFormat.Gif);//图片类型位GIF
byte[] imgByte = new byte[Ms.Length];
Ms.Position = 0;
Ms.Read(imgByte, 0, Convert.ToInt32(Ms.Length));
Ms.Close();
return imgByte;//返回字节数组
}
<?xml version="1.0" encoding="utf-8" ?>
<base64Binary xmlns="http://WebXml.com.cn/">ADSSS</base64Binary>