<br />using System;<br />using System.Runtime;<br />using System.Runtime.InteropServices;<br /><br />class IsConnected<br />{<br /> //Creating the extern function...<br /> [DllImport("wininet.dll")]<br /> private extern static bool InternetGetConnectedState(int out Description, int ReservedValue);<br /><br /> //Creating a function that uses the API function...<br /> public static bool IsConnectedToInternet()<br /> {<br /> int Desc;<br /><br /> return InternetGetConnectedState(out Desc, 0);<br /> }<br />}<br />
<br />Error 1: Identifier expected; 'out' is a keyword | Line: 9<br />Error 2: Invalid token ',' in class, struct, or interface member declaration | Line: 9<br />Error 3: ; expected | Line: 9<br />
private extern static bool InternetGetConnectedState(out int Description, int ReservedValue);
InternetGetConnectedState(out int Description, ...
var