src snippet


SUBMITTED BY: ghostsocket

DATE: July 24, 2020, 8:07 p.m.

UPDATED: July 24, 2020, 9:10 p.m.

FORMAT: C#

SIZE: 691 Bytes

HITS: 2341

  1. public async Task<_2CaptchaResult> GetBalance()
  2. {
  3. var getData = new List<KeyValuePair<string, string>>
  4. {
  5. new KeyValuePair<string, string>("key", _apiKey),
  6. new KeyValuePair<string, string>("action", "getbalance"),
  7. new KeyValuePair<string, string>("json", "1")
  8. };
  9. var inResponse = await _httpClient.PostAsync(_apiUrl + "res.php", new FormUrlEncodedContent(getData));
  10. var inJson = await inResponse.Content.ReadAsStringAsync();
  11. var @in = JsonConvert.DeserializeObject<_2CaptchaResultInternal>(inJson);
  12. if (@in.Status == 0)
  13. {
  14. return new _2CaptchaResult(false, @in.Request);
  15. }
  16. return new _2CaptchaResult(true, @in.Request);
  17. }

comments powered by Disqus