Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools

Check whether the user is working off-line

Total Hit ( 3375)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


Internet Explorer offers the possibility to simulate an Internet connection with the off-line mode. If you want to know if off-line mode is on or off you can use InternetQueryOption API.

Click here to copy the following block
Const INTERNET_OPTION_CONNECTED_STATE = 50
Const INTERNET_STATE_DISCONNECTED_BY_USER = &H10

Private Type INTERNET_CONNECTED_INFO
  dwConnectedState As Long
  dwFlags As Long
End Type
Private Declare Function InternetQueryOption Lib "wininet.dll" Alias _
  "InternetQueryOptionA" (ByVal hInternet As Long, ByVal dwOption As Long, _
  lpBuffer As INTERNET_CONNECTED_INFO, lpdwBufferLength As Long) As Boolean

' Return True if the user is working off-line

Function IsWorkingOffLine() As Boolean
  Dim dwState As Long, dwSize As Long
  Dim ci As INTERNET_CONNECTED_INFO

  dwState = 0
  dwSize = LenB(dwState)

  If InternetQueryOption(0&, INTERNET_OPTION_CONNECTED_STATE, ci, dwSize) Then
    IsWorkingOffLine = (ci.dwConnectedState And _
      INTERNET_STATE_DISCONNECTED_BY_USER)
  End If
End Function


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.