Since .NET Framework 2.0 there is a very easy way to perform an asynchronous HTTP request and retrieve the result as a string.
The System.Net.WebClient class provides methods and events to handle this task in a very convenient way:
using System.Net;
private void Button_Click(object sender, RoutedEventArgs e)
{
string topic=this.SearchTextBox.Text;
string url = "http://yourserver.com";
WebClient client = new WebClient();
client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);
client.DownloadStringAsync(new Uri(url));
}
void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
if (e.Error == null)
{
string result = e.Result;
}
}