public bool CheckIsWork() { try { Leaf.xNet.HttpResponse mainPageContent = httpRequest.Get(BASE_URL); if (mainPageContent.ToString().Length > 0) { return(true); } } catch (Exception) { } return(false); }
public void Create(double amountRUB, double amountBTC, string phone, string addressBTC, string email) { Parser parser = new Parser(current.ToString()); IElement form = parser.GetForm("form"); List <ParserInputData> inputs = parser.GetInputsByForm(form); parser.ModifyInputs(ref inputs, "rub_amount", amountRUB.ToString()) .ModifyInputs(ref inputs, "btc_amount", amountBTC.ToString()) .ModifyInputs(ref inputs, "btc_address", addressBTC) .ModifyInputs(ref inputs, "number", phone); string action = BASE_URL + form.GetAttribute("action").Substring(1); current = httpRequest.Post(action, HttpHelper.ConvertToRequestParams(inputs)); }
public ActionResult VerfiyCaptcha(YandexCaptchaModel captchaModel) { var request = new Leaf.xNet.HttpRequest(); //request.Cookies = new Leaf.xNet.CookieStorage(); request.UserAgent = Leaf.xNet.Http.ChromeUserAgent(); request.AddHeader("key", WebUtility.UrlEncode(captchaModel.key)); request.AddHeader("retpath", WebUtility.UrlEncode(captchaModel.retkey)); request.AddHeader("rep", WebUtility.UrlEncode(captchaModel.rep)); //request.AddHeader("Host","yandex.com"); try { Leaf.xNet.HttpResponse response = request.Get($"http://yandex.com/xcheckcaptcha?key={captchaModel.key}&rep={captchaModel.rep}");;; } catch (Exception) { return(RedirectToAction("Index", new { SearchText = captchaModel.searchText })); } return(RedirectToAction("Index", new { SearchText = captchaModel.searchText })); }
public void LoadMainPage() { current = httpRequest.Get(BASE_URL); }