Code:
string URL = "http://google.com"; HttpWebRequest GetRequest = (HttpWebRequest)WebRequest.Create(URL); GetRequest.Method = "GET"; GetRequest.CookieContainer = Jar; GetRequest.UserAgent = "User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:13.0) Gecko/20100101 Firefox/13.0.1"; GetRequest.KeepAlive = true; HttpWebResponse GetResponse = (HttpWebResponse)GetRequest.GetResponse(); StreamReader GetReader = new StreamReader(GetResponse.GetResponseStream()); richTextBox1.Text = GetReader.ReadToEnd();
so i tried to use asynchronous but i cant understand it so anyone here can tell me how could i convert the code above to async so it wont freeze the program