In C#, if statement I am capturing the length property and want to apply condition statement for that. But i believe my condition statement is not working. How should I apply condition statement for the given code. length "66" means internet connection is down else its up.
WebClient client = new WebClient();
string value;
try
{
value = client.DownloadString("http://google.com");
}
catch(WebException ex)
{
value = (ex. Message);
}
if (value = "66")
{
Console.WriteLine("Internet connection is down");
}
else
{
Console.WriteLine("Internet connection is up");
}
Console.WriteLine(value.Length);
Console.WriteLine("Press any key to continue");
Console.ReadKey(true);