Maybe start downloading the file and intercept the errors, including the ones related to connection.
The result of checking connection is not necessarily valid after the check.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello everybody,
I need to check if a internet connection exists because the little program i wrote download a file from a server.
I found a example but this isn't working?!
bool checkInternet = new Ping().Send("google.com", 500).Status == IPStatus.Success;
if (checkInternet == false)
{
MessageBoxButton button = MessageBoxButton.OK;
string caption = "Internet Error";
MessageBox.Show("Bitte Internetverbindung überprüfen und erneut versuchen.", caption, button);
}
Does anybody know how I can solve the problem?
Maybe start downloading the file and intercept the errors, including the ones related to connection.
The result of checking connection is not necessarily valid after the check.