private void btnSend_Click(object sender, EventArgs e) { btnSend.Enabled = false; PostPackageBuilder postVars = new PostPackageBuilder(); postVars.AddVariable("name", txtMessage.Text); if (!http.IsBusy) { http.Post(txtAddress.Text, postVars); } }
private void btnSendTest2_Click(object sender, EventArgs e) { btnSendTest2.Enabled = false; PostPackageBuilder postVars = new PostPackageBuilder(); string code = rsa.Encrypt(txtMessage2.Text); postVars.AddVariable("code", code); txtEncrypted2.Text = code; if (!http2.IsBusy) { http2.Post(txtAddress2.Text, postVars); } }
/// <summary> /// Send a POST request to a web page asynchronously. The response will be returned in OnHttpResponse. /// </summary> /// <param name="url">The address to POST to.</param> /// <param name="postVars">The list of variables to POST to the server.</param> public bool Post(string url, PostPackageBuilder postVars, ProxySettings settings) { return(Post(url, postVars.PostDataString, settings)); }
/// <summary> /// Send a POST request to a web page. Returns the contents of the page. /// </summary> /// <param name="url">The address to POST to.</param> /// <param name="postVars">The list of variables to POST to the server.</param> public string Post(string url, PostPackageBuilder postVars) { ProxySettings settings = new ProxySettings() { UseProxy = false }; return Post(url, postVars.PostDataString, settings); }
/// <summary> /// Send a POST request to a web page. Returns the contents of the page. /// </summary> /// <param name="url">The address to POST to.</param> /// <param name="postVars">The list of variables to POST to the server.</param> public string Post(string url, PostPackageBuilder postVars, ProxySettings settings) { return Post(url, postVars.PostDataString, settings); }