Change your code to below.
public static void isConnected()
{
WebClient client = new WebClient();
client.OpenReadCompleted += new OpenReadCompletedEventHandler(client_OpenReadCompleted);
client.OpenReadAsync(new Uri("http://www.google.com"));
}
static void client_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
reply = (Stream)e.Result;
s = new StreamReader (reply);
string strResult = s.ReadToEnd ();
}