Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

InternetGetConnectedState (wininet)
 
.
Summary
TODO - a short description

C# Signature:

[DllImport("wininet.dll", SetLastError=true)]
extern static bool InternetGetConnectedState(
   out InternetGetConnectedStateFlags Description, int ReservedValue);

VB Signature:

  Private Declare Function InternetGetConnectedState Lib "wininet.dll" _
(ByRef lpdwFlags As Int32, ByVal dwReserved As Int32) As Boolean

User-Defined Types:

InternetGetConnectedStateFlags

Notes:

Private Enum ConnectionStates
    Modem = &H1
    LAN = &H2
    Proxy = &H4
    RasInstalled = &H10
    Offline = &H20
    Configured = &H40
End Enum

Tips & Tricks:

Please add some!

Sample Code:

C: http://support.microsoft.com/default.aspx?scid=kb;EN-US;242558

C#: http://www.aspemporium.com/aspEmporium/cshrp/howtos/howto.asp?hid=27

Alternative Managed API:

Try NetworkInterface.GetIsNetworkAvailable() in the the System.Net.NetworkInformation namespace. It returns true when a network is available and false otherwise. See also: http://msdn2.microsoft.com/en-us/library/system.net.networkinformation.networkinterface.getisnetworkavailable(VS.80).aspx. NOTE: this is all new in .NET 2.0!

Documentation

Direct Link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/internetgetconnectedstate.asp

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Find References
Show Printable Version
Revisions