【发布时间】:2016-11-14 01:09:36
【问题描述】:
我正在尝试使用 C# 为浏览器游戏创建机器人,但我必须使用 Gecko 网络浏览器。
游戏登录页面有验证码,如果我打开图片链接,验证码会改变。所以我需要将验证码图像保存在磁盘上并在图片框中使用它,但我不知道如何。
验证码图片没有任何名称或id标签,来源是:code.php?938080。
我找到了Catching captcha image,但我不知道如何为我的案例和 Gecko 转换它。
foreach (HtmlElement img in wb.Document.Images)
{
isitcaptcha = img.OuterHtml.IndexOf("Captcha", 0);
if (isitcaptcha > 0)
{
captchaimg = img.OuterHtml.ToString();
上面写着:
Cannot convert type 'Gecko.GeckoHtmlElement' to 'System.Windows.Forms.HtmlElement'
The name 'isitcaptcha' does not exist in the current context
The name 'captchaimg' does not exist in the current context
【问题讨论】:
-
为什么要标记 php?
-
推荐标签! idk 也许有帮助
-
建议的标签是自动的,您可以根据需要添加/删除。