如何从httpresponsemessage获取验证码图像

编程入门 行业动态 更新时间:2024-10-11 21:29:20
本文介绍了如何从httpresponsemessage获取验证码图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

亲爱的所有人, 我正在使用HttpClient获取页面内容。

Dear All, I am using "HttpClient" go get a content of a page.

using (HttpResponseMessage response = await client.GetAsync(URl)) { using (HttpContent content = response.Content) { string myContent = await content.ReadAsStringAsync(); } }

Captcha部分是这样的:

the Captcha section is coming like this:

<script type="text/javascript"> $(document).ready(function () { $('#Captcha').val(''); $('#Cbtn').click(function () { $('#Cimage').attr('src', function () { if ($("#Key").length>0) return "/Common/GetRandomCaptchaImage" + '?' + Math.random() + "&key=" + $('#Key').val(); else return "/Common/GetRandomCaptchaImage" + '?' + Math.random(); }); }); $('#Cbtn').trigger('click'); }); </script> <div> <img id="Cimage" style="height:30px;width:150px;"/>

如何获得验证码图片。 谢谢。 什么我试过了: 我试图把结果放到网页浏览器控件中但没有结果。 谢谢。

How can I get the Captcha Image. Thanks. What I have tried: I tried to put the result into a web browser control but no result. Thanks.

推荐答案

(document).ready(function(){ (document).ready(function () {

('#Captcha')。val(''); ('#Captcha').val('');

('#Cbtn')。click(function(){ ('#Cbtn').click(function () {

更多推荐

如何从httpresponsemessage获取验证码图像

本文发布于:2023-11-24 23:41:02,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1627386.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:验证码   图像   httpresponsemessage

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!