这是图片你怎么获取源码啊?
[C#] 纯文本查看 复制代码 protected void Page_Load(object sender, EventArgs e)
{
HttpHelper http = new HttpHelper();
HttpItem item = new HttpItem()
{
URL = "https://gd1.alicdn.com/imgextra/i1/2141286258/tb2fonpqvxxxxc9xxxxxxxxxxxx_!!2141286258.jpg",
Method = "get",//URL 可选项 默认为Get
ResultType = ResultType.Byte
};
HttpResult result = http.GetHtml(item);
Image img = byteArrayToImage(result.ResultByte);
}
/// <summary>
/// 字节数组生成图片
/// </summary>
/// <param name="Bytes">字节数组</param>
/// <returns>图片</returns>
private Image byteArrayToImage(byte[] Bytes)
{
MemoryStream ms = new MemoryStream(Bytes);
return Bitmap.FromStream(ms, true);
}
参考文章http://www.sufeinet.com/thread-10024-1-1.html
|