private void button1_Click(object sender, EventArgs e)
{
System.Threading.Thread myThread = new System.Threading.Thread(ProcessedF);
myThread.Start();
}
}
void ProcessedF()
{
int lineCount = textBox1.Lines.Length;
for (int i = 0; i < lineCount; i++)
{
string random_item = "109.234.155.197";
BeginInvoke(new MethodInvoker(() => label1.Text = (Convert.ToInt32(label1.Text) + 1).ToString()));
string str = textBox1.Lines[i].ToString();
string [] split = str.Split(new Char [] {':'});
string id = split[0];
string auth = split[1];
HttpWebRequest myHttpWebRequest = (HttpWebRequest)HttpWebRequest.Create("http://" + random_item + "/prison/universal.php?name=vk.com/mobileprison&method=renamehouse&key=" + auth + "&user=" + id);
HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
StreamReader myStreamReader = new StreamReader(myHttpWebResponse.GetResponseStream(), Encoding.GetEncoding(1251));
string text_check = myStreamReader.ReadToEnd();
Thread.Sleep(100);
}
BeginInvoke(new MethodInvoker(() => label1.Text = (Convert.ToInt32(label1.Text) + 1).ToString()));
myStreamReader.Close()
using
using (StreamReader myStreamReader = new StreamReader(myHttpWebResponse.GetResponseStream(), Encoding.GetEncoding(1251)))
{
//This allows you to do one Read operation.
Console.WriteLine(sr.ReadToEnd());
}