Everlast
Member
Hello!Im reading in google about C# and still looking for a internet connection check script,i find this script,and load fine,but dont know how to do the call from another one.Someone have the knowdelegde and help?Thank you.
Script:
The issue is in discord bot module of Vitanex,if try to send message when connection is off,server freezes untill shutdown.
Script:
C#:
using System ;
using System.Runtime ;
using System.Runtime.InteropServices ;
public class InternetCS
{
//Creating the extern function...
[DllImport("wininet.dll")]
private extern static bool InternetGetConnectedState( out int Description, int ReservedValue ) ;
//Creating a function that uses the API function...
public static bool IsConnectedToInternet( )
{
int Desc ;
return InternetGetConnectedState( out Desc, 0 ) ;
}
}