{"id":28380,"date":"2026-11-22T09:05:33","date_gmt":"2026-11-22T09:05:33","guid":{"rendered":"https:\/\/capskip.com\/?p=28380"},"modified":"2026-11-22T09:05:33","modified_gmt":"2026-11-22T09:05:33","slug":"yandex-smartcaptcha-csharp","status":"publish","type":"post","link":"https:\/\/capskip.com\/zh\/yandex-smartcaptcha-csharp\/","title":{"rendered":"C# \u4e2d\u7684 Yandex SmartCaptcha\uff1a\u7528 YandexSmartAsync \u8bc6\u522b"},"content":{"rendered":"<p>To solve Yandex SmartCaptcha in C# without a browser of your own, fetch the page with an HttpClient that keeps cookies, read the sitekey from the data-sitekey attribute of the widget, and pass it to YandexSmartAsync from the CapSkip NuGet package. The token that comes back goes into the form field smart-token, posted under the same User-Agent the solve was given (my mock enforces this, and no real site is shown to). The solving happens on your own Windows PC in the <a href=\"https:\/\/capskip.com\/yandex-captcha-solver\/\">CapSkip Yandex SmartCaptcha solver<\/a>, with no fee per token.<\/p>\n<h2 style=\"font-size:1.6rem;line-height:1.35;\">What you need<\/h2>\n<ul>\n<li>CapSkip installed on a Windows PC, in a release that lists Yandex SmartCaptcha (the changelog has it from CapSkip 5.0.0). Install it by following the <a href=\"https:\/\/capskip.com\/setup-guide\/\">setup guide<\/a>. I could not read the version of a running app, so every result below comes from a mock.<\/li>\n<li>A .NET SDK (I used 10.0.100, and a machine with only the 8 SDK is untried) and the CapSkip NuGet package 1.8.0, the first version with YandexSmartAsync. Its nuspec names one target, netstandard2.0, and one dependency, System.Text.Json 8.0.5. My code ran on net8.0 (runtime 8.0.27) and net10.0 (runtime 10.0.0), both built with SDK 10.0.100, and nothing older was tried.<\/li>\n<li>A sign-up, login or contact page that carries a SmartCaptcha widget and that you are allowed to automate.<\/li>\n<li>An address for CapSkip. Local mode keeps the solver on 127.0.0.1, reachable only from the same PC. Server mode listens on your network or public IP as well, for calls from other machines. The <a href=\"https:\/\/capskip.com\/setup-guide\/#connection-settings\">connection settings<\/a> choose between them.<\/li>\n<\/ul>\n<p>Everything below ran against a mock. It plays in.php, res.php and a sign-up site, and the form rules are mine. No Yandex page was contacted and no real token was produced, so I say nothing about what a real token looks like or how long a real solve takes.<\/p>\n<h2 style=\"font-size:1.6rem;line-height:1.35;\">Step 1: create the project and read the page<\/h2>\n<div data-no-translation>\n<pre data-enlighter-language=\"bash\" class=\"EnlighterJSRAW\">dotnet new console -o yandex-demo\ncd yandex-demo\ndotnet add package CapSkip --version 1.8.0<\/pre>\n<\/div>\n<p>With SDK 10 the new project targets net10.0. To build for net8.0, open yandex-demo.csproj and change the TargetFramework line to net8.0. Delete everything in Program.cs, then paste the three C# blocks below in order. Only the first one has using lines.<\/p>\n<p>Yandex describes the widget as an empty div with the class smart-captcha and the client key in data-sitekey. A page that draws the widget from its own script passes the same key to smartCaptcha.render, as the Yandex section of the <a href=\"https:\/\/capskip.com\/api-docs\/#yandex-smartcaptcha\">CapSkip API docs<\/a> explains. Once a visitor passes, the widget inserts a hidden input named smart-token into the container, so the HTML you download has no such field and the code adds it itself (Yandex <a href=\"https:\/\/yandex.cloud\/en\/docs\/smartcaptcha\/quickstart\" rel=\"noopener nofollow\" target=\"_blank\">quickstart<\/a>).<\/p>\n<p>A regex for the key has to cope with attribute order, quote style and look-alikes, so the first block looks only at tags whose class attribute lists smart-captcha. A stylesheet or script file with that name in its address, or an id of the same name, does not count. It tries each such tag for data-sitekey and then falls back to a smartCaptcha.render call. Against my mock it read the right key in eight page shapes on both runtimes: data-sitekey after the class; before the class in single quotes; unquoted; a stylesheet and a script with that name above the widget; a key only in a render call; an id div next to a render call; an id div wrapping the real widget; and a search form above the real one. A key held in a variable, as in sitekey: k, is not supported and raised the no-sitekey exception.<\/p>\n<p>The block then works inside the form that contains the widget, so a search form higher up the page is not taken for the real one. It copies that form&#8217;s hidden inputs into a dictionary, which is how a CSRF field travels to the form post, and reads its action. The SDK checks the key itself: 16 to 120 letters, digits, underscores or hyphens, usually starting with ysc1_.<\/p>\n<div data-no-translation>\n<pre data-enlighter-language=\"csharp\" class=\"EnlighterJSRAW\">using System.Net;\nusing System.Text.RegularExpressions;\nusing CapSkip;\n\/\/ Implicit usings import System, which has a TimeoutException too (a bare one fails with CS0104).\nusing SolverTimeout = CapSkip.TimeoutException;\n\n\/\/ What the page gives you: the sitekey, the form that holds the widget, and its hidden fields.\nrecord PageForm(string Sitekey, string Action, Dictionary&lt;string, string&gt; Hidden);\n\nstatic class Page\n{\n    \/\/ A tag whose class attribute lists smart-captcha, in any attribute order. A stylesheet,\n    \/\/ a script src or an id of the same name does not count.\n    static readonly Regex Widget = new(@&quot;&lt;[^&gt;]*\\bclass\\s*=\\s*(?&lt;q&gt;[&quot;&quot;'])[^&quot;&quot;']*(?&lt;![\\w-])smart-captcha(?![\\w-])[^&quot;&quot;']*\\k&lt;q&gt;[^&gt;]*&gt;&quot;, RegexOptions.IgnoreCase);\n    static readonly Regex DataKey = new(@&quot;data-sitekey\\s*=\\s*(?&lt;q&gt;[&quot;&quot;']?)(?&lt;k&gt;[\\w-]+)\\k&lt;q&gt;&quot;, RegexOptions.IgnoreCase);\n    \/\/ Pages that draw the widget from script pass a quoted key to smartCaptcha.render.\n    static readonly Regex Render = new(@&quot;smartCaptcha\\.render\\([^;]*?sitekey\\s*:\\s*(?&lt;q&gt;[&quot;&quot;'])(?&lt;k&gt;[^&quot;&quot;']+)\\k&lt;q&gt;&quot;, RegexOptions.Singleline);\n    static readonly Regex Input = new(@&quot;&lt;input\\b[^&gt;]*&gt;&quot;, RegexOptions.IgnoreCase);\n    static readonly Regex Attr = new(@&quot;(?&lt;n&gt;[\\w-]+)\\s*=\\s*(?&lt;q&gt;[&quot;&quot;'])(?&lt;v&gt;[^&quot;&quot;']*)\\k&lt;q&gt;&quot;);\n    static readonly Regex FormAction = new(@&quot;&lt;form\\b[^&gt;]*\\baction\\s*=\\s*(?&lt;q&gt;[&quot;&quot;'])(?&lt;a&gt;[^&quot;&quot;']*)\\k&lt;q&gt;&quot;, RegexOptions.IgnoreCase);\n\n    public static PageForm Read(string html)\n    {\n        string? sitekey = null;\n        var at = 0;\n        foreach (Match tag in Widget.Matches(html))\n        {\n            var k = DataKey.Match(tag.Value);\n            if (k.Success) { sitekey = k.Groups[&quot;k&quot;].Value; at = tag.Index; break; }\n        }\n        if (sitekey is null)\n        {\n            var r = Render.Match(html);\n            if (r.Success) { sitekey = r.Groups[&quot;k&quot;].Value; at = r.Index; }\n        }\n        if (sitekey is null) throw new InvalidDataException(&quot;no SmartCaptcha sitekey on the page&quot;);\n\n        \/\/ Work inside the form that holds the widget, so a search box above it is ignored.\n        var start = Math.Max(0, html.LastIndexOf(&quot;&lt;form&quot;, at, StringComparison.OrdinalIgnoreCase));\n        var end = html.IndexOf(&quot;&lt;\/form&quot;, at, StringComparison.OrdinalIgnoreCase);\n        var form = html.Substring(start, (end &lt; 0 ? html.Length : end) - start);\n\n        var hidden = new Dictionary&lt;string, string&gt;();\n        foreach (Match input in Input.Matches(form))\n        {\n            var a = new Dictionary&lt;string, string&gt;();\n            foreach (Match m in Attr.Matches(input.Value))\n                a[m.Groups[&quot;n&quot;].Value.ToLowerInvariant()] = WebUtility.HtmlDecode(m.Groups[&quot;v&quot;].Value);\n            if (a.GetValueOrDefault(&quot;type&quot;) == &quot;hidden&quot; &amp;&amp; a.TryGetValue(&quot;name&quot;, out var name))\n                hidden[name] = a.GetValueOrDefault(&quot;value&quot;, &quot;&quot;);\n        }\n        return new PageForm(sitekey, FormAction.Match(form).Groups[&quot;a&quot;].Value, hidden);\n    }\n}<\/pre>\n<\/div>\n<h2 style=\"font-size:1.6rem;line-height:1.35;\">Step 2: solve with YandexSmartAsync and send the form<\/h2>\n<p>The second block does one whole submission: a page fetch, a solve and a form post. Three details matter.<\/p>\n<p>First, the HttpClient owns a CookieContainer, so the session cookie from the page fetch rides along with the form post, and the CSRF field copied from the page matches it. Second, one User-Agent string serves the page fetch, the userAgent option and the form post. The option tells CapSkip which User-Agent to present to Yandex (SDK docs). In my mock the site compares the User-Agent of the form post with the one the task carried: a task sent with Other\/1.0 got 403 on all three attempts, and a task sent without the option carried none and passed. That rule is mine, so the mock cannot show that Yandex or any real site cares. Keeping one string costs a single constant. If you leave the option out, the CapSkip API docs say a current Chrome User-Agent is presented, which will not equal the string HttpClient sends.<\/p>\n<p>Third, the solve comes after the page fetch and right before the post, with a fresh page every time. Yandex says a token stays valid for five minutes and can be checked only once (<a href=\"https:\/\/yandex.cloud\/en\/docs\/smartcaptcha\/concepts\/validation\" rel=\"noopener nofollow\" target=\"_blank\">validation docs<\/a>), so a reused or hoarded token fails. I cannot tell whether a refused form post uses the token up, so the loop in the next step fetches a new page and solves again after every refusal. The Referer line is there because some frameworks refuse a form post that has neither Referer nor Origin, and HttpClient sends neither on its own. With the line deleted my mock refused all three attempts, because I wrote it to.<\/p>\n<div data-no-translation>\n<pre data-enlighter-language=\"csharp\" class=\"EnlighterJSRAW\">static class Flow\n{\n    \/\/ One string, used for the page fetch, the solve and the form post.\n    public const string UserAgent = &quot;Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/146.0.0.0 Safari\/537.36&quot;;\n\n    \/\/ Local mode. In Server mode, use your server's address instead. If API Key\n    \/\/ Validation is on in CapSkip, also pass apiKey: &quot;YOUR_KEY&quot; here.\n    public static readonly CapSkipClient Solver = new(host: &quot;127.0.0.1&quot;, port: 8080);\n\n    public static HttpClient NewHttp()\n    {\n        var http = new HttpClient(new HttpClientHandler { CookieContainer = new CookieContainer(), UseCookies = true });\n        http.DefaultRequestHeaders.TryAddWithoutValidation(&quot;User-Agent&quot;, UserAgent);\n        return http;\n    }\n\n    \/\/ One whole submission: fresh page, fresh token, form post. Never reuse a token.\n    public static async Task&lt;(int Status, string Text)&gt; Submit(HttpClient http, string pageUrl, string email, CancellationToken ct)\n    {\n        var form = Page.Read(await http.GetStringAsync(pageUrl, ct));\n\n        \/\/ Solve after the page is in hand and right before the post: a token lives 5 minutes.\n        var solved = await Solver.YandexSmartAsync(form.Sitekey, pageUrl,\n            new Dictionary&lt;string, object?&gt; { [&quot;userAgent&quot;] = UserAgent }, ct);\n\n        var fields = new Dictionary&lt;string, string&gt;(form.Hidden) { [&quot;email&quot;] = email, [&quot;smart-token&quot;] = solved.Token! };\n        using var request = new HttpRequestMessage(HttpMethod.Post, new Uri(new Uri(pageUrl), form.Action))\n        {\n            Content = new FormUrlEncodedContent(fields),\n        };\n        request.Headers.Referrer = new Uri(pageUrl);   \/\/ some frameworks refuse a post without one\n        using var response = await http.SendAsync(request, ct);\n        var body = await response.Content.ReadAsStringAsync(ct);\n        return ((int)response.StatusCode, Regex.Replace(body, &quot;&lt;[^&gt;]+&gt;&quot;, &quot; &quot;).Trim());\n    }\n}<\/pre>\n<\/div>\n<p>The result carries the token twice, as Token and as Code, and the two were the same string in my probe. Use Token. Code is there so that code written against another 2Captcha client, which reads one field for every CAPTCHA type, keeps working. These are the options YandexSmartAsync takes, as the 1.8.0 source and docs list them.<\/p>\n<table>\n<thead>\n<tr>\n<th>Option<\/th>\n<th>What it does<\/th>\n<th>Seen in the mock<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>userAgent<\/td>\n<td>The User-Agent CapSkip presents to Yandex. The names &quot;useragent&quot; and &quot;user_agent&quot; work too<\/td>\n<td>Arrived as &quot;useragent&quot;. An empty string is not sent<\/td>\n<\/tr>\n<tr>\n<td>proxy<\/td>\n<td>A Proxy object, a plain address or a type and uri pair<\/td>\n<td>Arrived as proxy plus proxytype HTTP<\/td>\n<\/tr>\n<tr>\n<td>&quot;timeout&quot; and &quot;polling_interval&quot;<\/td>\n<td>Seconds to keep polling and the longest pause between polls, as on the other methods<\/td>\n<td>A timeout of 5 on a default client ended a never-ready task after 7.85 s (net8.0) and 7.86 s (net10.0). A polling interval of 1 gave a token after 3.87 s on both<\/td>\n<\/tr>\n<tr>\n<td>pageurl<\/td>\n<td>Stands in for the url argument<\/td>\n<td>A null url with pageurl set was sent<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Anything else, except the SDK&#8217;s own timeout and polling_interval, is refused. Passing action, which MTCaptcha takes, or invisible, which hCaptcha takes, raised a ValidationException before any request. If the site reads the visitor address and sends it to Yandex, the CapSkip Yandex page says to use one proxy for the solve and the form post. The <a href=\"https:\/\/capskip.com\/captcha-solver-proxy\/\">proxy guide<\/a> has the setup steps.<\/p>\n<h2 style=\"font-size:1.6rem;line-height:1.35;\">Step 3: run Yandex SmartCaptcha in C# end to end<\/h2>\n<p>The last block holds Main. Point PageUrl at your own sign-up page, because a first run against example.com prints a 404 message from the failed page fetch and never reaches the widget. Run it with dotnet run. Up to three submissions run under one cancellation budget, and a form answer below 400 ends the run. A CapSkip error ends it as well, since sending the same task again cannot change the answer.<\/p>\n<p>The budget is ten minutes because each solve may wait up to recaptchaTimeout, 300 seconds by default, so two stalled attempts already use all of it (arithmetic from the defaults, not a run). Lower the budget if your site cannot wait that long.<\/p>\n<div data-no-translation>\n<pre data-enlighter-language=\"csharp\" class=\"EnlighterJSRAW\">static class Program\n{\n    const string PageUrl = &quot;https:\/\/example.com\/signup&quot;;  \/\/ the page that shows the SmartCaptcha widget\n\n    static async Task&lt;int&gt; Main()\n    {\n        \/\/ Solves may take a while, so one budget covers every attempt below.\n        using var budget = new CancellationTokenSource(TimeSpan.FromMinutes(10));\n        using var http = Flow.NewHttp();\n        try\n        {\n            for (var attempt = 1; attempt &lt;= 3; attempt++)\n            {\n                var (status, text) = await Flow.Submit(http, PageUrl, &quot;you@example.com&quot;, budget.Token);\n                Console.WriteLine($&quot;attempt {attempt}: {status} {text}&quot;);\n                if (status &lt; 400) return 0;\n            }\n            Console.WriteLine(&quot;the site refused 3 submissions&quot;);\n        }\n        catch (Exception) when (budget.IsCancellationRequested) { Console.WriteLine(&quot;the 10 minute budget ran out&quot;); }\n        catch (ValidationException ex) { Console.WriteLine($&quot;CapSkip refused the call: {ex.Message}&quot;); }\n        catch (ApiException ex) { Console.WriteLine($&quot;CapSkip answered {ex.Message}&quot;); }\n        catch (SolverTimeout ex) { Console.WriteLine($&quot;no token in time: {ex.Message}&quot;); }\n        catch (CapSkipError ex) { Console.WriteLine($&quot;{ex.GetType().Name}: {ex.Message}&quot;); }\n        \/\/ HttpClient's own timeout is a TaskCanceledException wrapping System.TimeoutException.\n        catch (TaskCanceledException ex) when (ex.InnerException is System.TimeoutException) { Console.WriteLine(&quot;the site answered too slowly&quot;); }\n        catch (HttpRequestException ex) { Console.WriteLine($&quot;the site did not answer: {ex.Message}&quot;); }\n        catch (InvalidDataException ex) { Console.WriteLine(ex.Message); }\n        return 1;\n    }\n}<\/pre>\n<\/div>\n<h2 style=\"font-size:1.6rem;line-height:1.35;\">Timeouts and cancellation<\/h2>\n<p>Yandex solves use recaptchaTimeout, 300 seconds by default, and not defaultTimeout, because CapSkip passes the widget in a real browser (SDK source). I checked that against the mock. With defaultTimeout set to 3 and a task that became ready only on the sixth poll, the call returned a token after 7.86 seconds on both runtimes, so the short timeout was ignored. With recaptchaTimeout set to 5 and a task that never became ready, the CapSkip TimeoutException arrived after 7.83 to 7.87 seconds in eight runs on the two runtimes, not after 5. The mock logged polls at about 0, 0.26, 0.78, 1.78 and 3.8 seconds. The SDK then slept 4 seconds, found the deadline passed and threw without a sixth poll, because it looks at the clock only after each sleep.<\/p>\n<p>The two TimeoutException types meet here. Implicit usings import System, which has its own TimeoutException, so a bare catch next to using CapSkip fails to build with error CS0104, as it did on both runtimes. The using line at the top of the first block renames the SDK class to SolverTimeout. HttpClient adds a third source: its own timeout is not a CapSkipError. A one second Timeout against a mock page that sleeps three seconds surfaced as a TaskCanceledException whose InnerException was System.TimeoutException, after 1.02 seconds on both runtimes.<\/p>\n<p>The CancellationToken reaches both the page fetch and the CapSkip calls. In the mock a budget of 2 seconds ran out in two places. While the mock held in.php open, the exception was a NetworkException wrapping a TaskCanceledException. While the SDK was polling, it was a plain TaskCanceledException. Both appeared after about 2.0 seconds. Main tests the budget itself, so one filter covers both shapes.<\/p>\n<p>Results from the mock follow. They say nothing about a real site and were identical on net8.0 and net10.0.<\/p>\n<table>\n<thead>\n<tr>\n<th>Mock setting<\/th>\n<th>What the program did<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Defaults, any of the three page shapes<\/td>\n<td>200 Account created, one task<\/td>\n<\/tr>\n<tr>\n<td>Site answers 403 to the first form post<\/td>\n<td>Second attempt with a new page and a new task, then 200<\/td>\n<\/tr>\n<tr>\n<td>Site refuses every form post<\/td>\n<td>Three attempts, three tasks, exit code 1<\/td>\n<\/tr>\n<tr>\n<td>ERROR_RECAPTCHA_INVALID_DOMAIN or ERROR_RECAPTCHA_INVALID_SITEKEY<\/td>\n<td>The reply printed, exit code 1, one task, no retry<\/td>\n<\/tr>\n<tr>\n<td>Page without a widget<\/td>\n<td>A message, exit code 1, no task sent<\/td>\n<\/tr>\n<tr>\n<td>Nothing listening at the CapSkip address<\/td>\n<td>NetworkException, exit code 1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 style=\"font-size:1.6rem;line-height:1.35;\">Common errors<\/h2>\n<table>\n<thead>\n<tr>\n<th>What you see<\/th>\n<th>Cause<\/th>\n<th>Fix<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>ValidationException<\/td>\n<td>The SDK refused the call before sending it: a sitekey outside 16 to 120 allowed characters, a page address that is not an absolute http or https URL, an unsupported proxy type, or an option the Yandex method lacks. Eleven such calls were refused and none reached the mock<\/td>\n<td>Fix the argument. Retrying cannot help<\/td>\n<\/tr>\n<tr>\n<td>ERROR_RECAPTCHA_INVALID_SITEKEY or ERROR_RECAPTCHA_INVALID_DOMAIN<\/td>\n<td>Yandex does not know the key, or it is not allowed on that domain (API docs; my mock raises both at the first poll)<\/td>\n<td>Re-read the key and the address from the page. Do not retry<\/td>\n<\/tr>\n<tr>\n<td>ERROR_CAPTCHA_UNSOLVABLE<\/td>\n<td>The challenge was not passed (listed in the API docs; I could only provoke it in the mock)<\/td>\n<td>Start a new submission with a fresh page<\/td>\n<\/tr>\n<tr>\n<td>ERROR_PROXY_CONNECT_REFUSED<\/td>\n<td>The task could not reach Yandex through its proxy (SDK docs)<\/td>\n<td>Check the proxy address<\/td>\n<\/tr>\n<tr>\n<td>CapSkip TimeoutException<\/td>\n<td>No token within recaptchaTimeout, noticed at the next poll<\/td>\n<td>Raise recaptchaTimeout or look at CapSkip<\/td>\n<\/tr>\n<tr>\n<td>The site refuses the form<\/td>\n<td>An expired or already checked token, per the Yandex docs. In my mock also a different User-Agent or no Referer<\/td>\n<td>Fetch, solve and post again in one pass<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 style=\"font-size:1.6rem;line-height:1.35;\">Server mode: CapSkip on a different PC<\/h2>\n<p>CapSkip can also run as a server on a Windows machine you control, so this program can live on another PC or host and call the solver over the API. Put that machine&#8217;s address in place of 127.0.0.1 in the CapSkipClient line, and set the mode in the <a href=\"https:\/\/capskip.com\/setup-guide\/#connection-settings\">connection settings<\/a>.<\/p>\n<p>Server mode leaves the CapSkip port reachable from every address. Narrow that down with a Windows Firewall block rule that covers every machine you do not expect, and switch on API Key Validation too, passing apiKey in the CapSkipClient line.<\/p>\n<h2 style=\"font-size:1.6rem;line-height:1.35;\">FAQ<\/h2>\n<details style=\"border:1px solid #e2e5ee;border-radius:10px;padding:14px 18px;margin:0 0 12px;\">\n<summary style=\"cursor:pointer;\">\n<h3 style=\"font-size:1.15rem;line-height:1.4;display:inline;margin:0;\">Does solving Yandex SmartCaptcha in C# need a browser?<\/h3>\n<\/summary>\n<p style=\"margin:12px 0 0;\">Not for the solve: CapSkip drives the widget itself. You need one only when the page builds its form with script, so that a plain download shows no form to post. Then use a browser tool and read the sitekey from the loaded page.<\/p>\n<\/details>\n<details style=\"border:1px solid #e2e5ee;border-radius:10px;padding:14px 18px;margin:0 0 12px;\">\n<summary style=\"cursor:pointer;\">\n<h3 style=\"font-size:1.15rem;line-height:1.4;display:inline;margin:0;\">Who checks the token?<\/h3>\n<\/summary>\n<p style=\"margin:12px 0 0;\">The site&#8217;s own server. It sends the token and its secret server key to Yandex, and Yandex answers with a status. You never hold that key. Do not check the token yourself before the form post, because a token can be checked only once.<\/p>\n<\/details>\n<details style=\"border:1px solid #e2e5ee;border-radius:10px;padding:14px 18px;margin:0 0 12px;\">\n<summary style=\"cursor:pointer;\">\n<h3 style=\"font-size:1.15rem;line-height:1.4;display:inline;margin:0;\">How long does a solve take?<\/h3>\n<\/summary>\n<p style=\"margin:12px 0 0;\">The CapSkip Yandex page says typically 15 to 30 seconds. I could not measure it, since no real solve ran. Budget for it with recaptchaTimeout and a CancellationToken.<\/p>\n<\/details>\n<p>Yandex SmartCaptcha in C# comes down to one page fetch, one YandexSmartAsync call and one form post that reuses the same User-Agent. With a flat-license <a href=\"https:\/\/capskip.com\/\">local captcha solver<\/a> running on your own PC, a refused form costs a few seconds and no fee. Other CAPTCHA types in .NET are covered on the <a href=\"https:\/\/capskip.com\/csharp-captcha-solver\/\">C# CAPTCHA solver page<\/a>, and the raw request format is in the <a href=\"https:\/\/capskip.com\/api-docs\/#yandex-smartcaptcha\">API docs<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CapSkip NuGet \u5305 1.8.0 \u7528\u4e00\u6b21 YandexSmartAsync \u8c03\u7528\u5c31\u80fd\u8bc6\u522b Yandex SmartCaptcha\u3002\u4e0b\u9762\u662f\u8bfb\u53d6 sitekey\u3001\u4fdd\u6301\u540c\u4e00\u4e2a User-Agent \u5e76\u63d0\u4ea4 smart-token \u5b57\u6bb5\u7684 C# \u4ee3\u7801\u3002<\/p>","protected":false},"author":1,"featured_media":28379,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"Yandex SmartCaptcha in C#: YandexSmartAsync Guide | CapSkip","rank_math_description":"Solve Yandex SmartCaptcha in C# with HttpClient: read the sitekey, call YandexSmartAsync, keep one User-Agent and post smart-token. Copy the code.","rank_math_focus_keyword":"yandex smartcaptcha in c#","footnotes":""},"categories":[70],"tags":[],"class_list":["post-28380","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-captcha"],"_links":{"self":[{"href":"https:\/\/capskip.com\/zh\/wp-json\/wp\/v2\/posts\/28380","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/capskip.com\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/capskip.com\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/capskip.com\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/capskip.com\/zh\/wp-json\/wp\/v2\/comments?post=28380"}],"version-history":[{"count":1,"href":"https:\/\/capskip.com\/zh\/wp-json\/wp\/v2\/posts\/28380\/revisions"}],"predecessor-version":[{"id":28391,"href":"https:\/\/capskip.com\/zh\/wp-json\/wp\/v2\/posts\/28380\/revisions\/28391"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/capskip.com\/zh\/wp-json\/wp\/v2\/media\/28379"}],"wp:attachment":[{"href":"https:\/\/capskip.com\/zh\/wp-json\/wp\/v2\/media?parent=28380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/capskip.com\/zh\/wp-json\/wp\/v2\/categories?post=28380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/capskip.com\/zh\/wp-json\/wp\/v2\/tags?post=28380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}