C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,819 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
How to display a message box if there is no internet connection in the system in C#? Pls provide the code for that!
A way =>
if(IsInternetConnected() == 0)
MessageBox.Show("Connected to Internet");
else
MessageBox.Show("Not connected to Internet");
Declaration :
[DllImport("Connect.dll", CharSet = CharSet.Unicode, SetLastError = true)]
public static extern HRESULT IsInternetConnected();