C#使用验证码提交表单

时间:2014-10-11 13:29:00

标签: c#

我正在尝试制作一个非常小的应用程序来发送联系表单。

到目前为止,这是我的代码。


Html (非常非常基本)。注意 - 验证码是动态的

<form id="myForm" method="POST">
    <input name="name" type="text" />
    <input name="email" type="text" />
    <div class="captcha"></div>
    <input name="captcha" type="text" />
    <input type="submit" value="Send" />
</form>


C# - 我可以使用POST发送表单,但没有验证码

    string URI = "http://localhost/contact.php";
    string myParameters = "name=John&email=info@contact.com&captcha=???">;

    using (WebClient wc = new WebClient())
    {
        wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
        wc.UploadString(URI, myParameters);
    }

我想在我的应用中显示验证码图像及其下方的文本框。 这可能吗?

0 个答案:

没有答案