C#通过socks5代理连接到URL

时间:2019-02-07 11:09:12

标签: c# webclient socks

im试图通过socks5代理连接到网页。我用于不使用代理的连接方法如下:

    public static void SubmitUrl(String urlP, String urlParams)
    {
        using(WebClient wc = new WebClient())
        {
            wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
            String HtmlResult = wc.UploadString(urlP, urlParams);
            if (HtmlResult.Contains("Your new password has been set"))
            {
                Console.WriteLine("new pw set");
            }
            else
            {
                if(HtmlResult.Contains("You have been temporarily blocked"))
                {
                    Console.WriteLine("blocked, attempt failed");
                }else
                {
                    Console.WriteLine("wrong output, retrying");
                    Thread.Sleep(4000);
                    SubmitUrl(urlP, urlParams);
                }

                //
            }
            //Console.WriteLine(HtmlResult);
        }
    }

我环顾四周,但没有结果。我也尝试过使用this库,但是我根本不理解。 (该文档是俄语的)

非常感谢您的帮助!

0 个答案:

没有答案