获取验证码图片

MOKA 2012-11-14 04:05:37
http://bbs.xiaomi.cn/thread-5488240-1-1.html

我想获取小米论坛的验证码图片,有什么办法

用C#解决
...全文
347 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
cs张 2012-11-28
  • 打赏
  • 举报
回复
有详细点的吗?
CheneyMa1s 2012-11-22
  • 打赏
  • 举报
回复
直接使用WebClient类的DownLoadFile
gzw13999 2012-11-16
  • 打赏
  • 举报
回复
办法很多,我给你的例子是最好最实用的。
MOKA 2012-11-15
  • 打赏
  • 举报
回复
还有什么办法么
gzw13999 2012-11-14
  • 打赏
  • 举报
回复
楼主仔细查阅下 httpWebRequest 与 httpWebResponse 这样,我的方法给你贴出来


public Stream GetStream()
        {
            
            HttpWebResponse httpWebResponse = null;
            HttpWebRequest httpWebRequest;

            httpWebRequest.Method = Method;
            httpWebRequest.Accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*";
            httpWebRequest.Headers["Accept-Charset"] = "GBK,utf-8;q=0.7,*;q=0.3";
            httpWebRequest.Headers["Accept-Language"] = "zh-CN,zh;q=0.8";
            httpWebRequest.Headers["Cache-Control"] = "max-age=0";
            httpWebRequest.ContentType = "application/x-www-form-urlencoded";




            httpWebRequest.CookieContainer = cookie;

            httpWebRequest.Referer = Url;
            httpWebRequest.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5";
            httpWebRequest.Proxy = null;
            httpWebRequest.AllowAutoRedirect = true;


            httpWebRequest.Timeout = 10000;


            httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();


            return httpWebResponse.GetResponseStream();
            

        }


this.pictureBox1.Image = GetStream();

1,979

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 其他语言讨论
社区管理员
  • 其他语言社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧