aardio 官方社区

用户名  找回密码
 注册会员

QQ登录

只需一步,快速开始

帖子
查看: 11774|回复: 2

下载图片 http 和 whttp 有什么区别?

[复制链接]

47

主题

129

回帖

951

积分

荣誉会员

积分
951
发表于 2011-9-2 12:50:18 | 显示全部楼层 |阅读模式
在网站下载图片
使用http 方式正常下载,并在窗体显示,但是改写为 whttp 方式就不能正常操作,请指教一下,其中的差别在哪里?同时应该注意哪些方面

http 方式
  1. str_url="http://pay.wanmei.com/e/servlet/getrandomimg?r=" + math.random()
  2. var http = inet.http();
  3. http.flags = 0x80000000   //_INTERNET_FLAG_RELOAD//图片都不一样
  4. ImgBuffer,errmsg = http.get(str_url)
  5. winform.picturebox.image = ImgBuffer
  6. http.close();//释放资源
复制代码


whttp

  1. str_url="http://pay.wanmei.com/e/servlet/getrandomimg?r=" + math.random()
  2. var whttp = inet.whttp();
  3. whttp.flags = 0x80000000   //_INTERNET_FLAG_RELOAD//图片都不一样
  4. ImgBuffer,errmsg = whttp.get(str_url)
  5. winform.picturebox.image = ImgBuffer
  6. whttp.close();//释放资源
复制代码


56

主题

412

回帖

3788

积分

荣誉会员

积分
3788
发表于 2011-9-2 13:09:37 | 显示全部楼层
本帖最后由 cbtan 于 2011-9-2 13:10 编辑
地址后面有  随机  math.random() 就不用加  下面的设置了啊
http.flags = 0x80000000   //_INTERNET_FLAG_RELOAD//图片都不一样
whttp.flags = 0x80000000   //_INTERNET_FLAG_RELOAD//图片都不一样

47

主题

129

回帖

951

积分

荣誉会员

积分
951
 楼主| 发表于 2011-9-2 16:16:32 | 显示全部楼层
原来是这个原因呀
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

手机版|未经许可严禁引用或转载本站文章|aardio.com|aardio 官方社区 ( 皖ICP备09012014号 )

GMT+8, 2025-6-14 02:34 , Processed in 0.055410 second(s), 23 queries .

Powered by Discuz! X3.5

Copyright © 2001-2024 Tencent Cloud.

快速回复 返回顶部 返回列表