- 积分
- 40165
- 好友
- 记录
- 主题
- 帖子
- 听众
- 收听
|
发表于 2013-7-5 08:38:42
|
显示全部楼层
使用我的类一定要记着看教程,你说的这些在教程里都有,你直接将Html转成Byte是肯定不行的呀,我返回的有Byte的,你看如下代码
[code=csharp] private Image byteArrayToImage(byte[] Bytes)
{
using (MemoryStream ms = new MemoryStream(Bytes))
{
Image outputImg = Image.FromStream(ms);
return outputImg;
}
}
private void Form1_Load(object sender, EventArgs e)
{
HttpHelper h = new HttpHelper();
HttpItem i = new HttpItem();
Image img;
i.URL = "http://login.sina.com.cn/cgi/pin.php?p=gz-a4631d4687a5aa214405e0bb7f5152f5019f&r=1372917061165";
i.ResultType = ResultType.Byte;
HttpResult result = h.GetHtml(i);
img = byteArrayToImage(result.ResultByte);
pictureBox1.Image = img;
}[/code] |
|