private void button7_Click(object sender, EventArgs e) { for (int I = 1; I < 7; I++) { text1.Text = text1.Text + HttpPost(URI,Parameters , Proxy[I]); } } ////////////////////////////////////////////////////////////////////////////////////// public static string HttpPost(string URI, string Parameters, string PROXY) string ResP = ""; WebProxy Prxy = new WebProxy(PROXY, true) ; System.Net.WebRequest req = System.Net.WebRequest.Create(URI); req.Proxy = PROXY; req.ContentType = "application/x-www-form-urlencoded"; req.Method = "POST"; byte[] bytes = System.Text.Encoding.ASCII.GetBytes(Parameters); req.ContentLength = bytes.Length; System.IO.Stream os = req.GetRequestStream(); os.Write(bytes, 0, bytes.Length); os.Close(); System.Net.WebResponse resp = req.GetResponse(); System.IO.StreamReader sr = new System.IO.StreamReader(resp.GetResponseStream()); ResP = sr.ReadToEnd().Trim(); resp.Close(); return ResP; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)