What is the best and quick way to connect the user to the Internet?
Try this:
1: /// & lt; Summary & gt; 2: /// Works on the network 3: /// & lt; / Summary & gt; 4: Public Seal Class NetworkHandler 5: {6: /// & lt; Summary & gt; 7: Private constructor to stop / compromise compiler from building a 8: ///, because this class is the only stable method and properties 9: /// & lt; / Summary & gt; 10: NetworkHandler () {} 11: 12: /// & lt; Summary & gt; 13: /// SafeNativeMethods class that puts unmanaged code security to keep the original 14: / / / root files stored 15: /// & lt; / Summary & gt; 16: [SuppressUnmanagedCodeSecurityAttribute] 17: Internal Static Class SafeNativeMethods 18: {19: // External Library 20: // UnManaged code - be careful. 21: [DllImport ("wininet.dll", Charset = Charset.auto)] 22: [Return: Marshall AS (Unmanaged Type Bowl)] 23: Private External Stool Bull 24: InternetGet ConnectedState (Outside Int Description, Interest Value) ; 25: 26: /// & lt; Summary & gt; 27: /// Whether or not this computer has an active connection. 28: /// & lt; / Summary & gt; 29: /// & lt; Returns & gt; & Lt; / Returns & gt; 30: Public Static Bull is Active Connection () 31: {32: Int Dess; 33: Returns InternetGet ConnectedState (External Number, 0); 34:} 35:} 36:}
Source:
Comments
Post a Comment