[英]How to upload a captcha image to 2captcha C#
I want to resolve a captcha, so I use 2captcha service, but I don't understand about posting request by multipart.我想解决验证码,所以我使用 2captcha 服务,但我不明白通过多部分发布请求。
Multipart sample:多部分样本:
<form method="post" action="http://2captcha.com/in.php" enctype="multipart/form-data">
<input type="hidden" name="method" value="post">
Your key:
<input type="text" name="key" value="YOUR_APIKEY">
The CAPTCHA file:
<input type="file" name="file">
<input type="submit" value="download and get the ID">
</form>
This is just a schematic view of the post request.这只是post请求的示意图。 Your post data will look like this:
method=post&key=your_apikey&file=...
您的帖子数据将如下所示:
method=post&key=your_apikey&file=...
I recommend to take a look at the base64 sample, then getting the captcha image as byte []
and converting it to base64 with something like Convert.ToBase64 (...)
.我建议查看 base64 示例,然后将验证码图像作为
byte []
并使用Convert.ToBase64 (...)
类的内容将其转换为 base64。
You can use WebClient to submit post requests.您可以使用 WebClient 提交发布请求。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.