VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Check if user is Online

by Hasenmann (1 Submission)
Category: Internet/HTML
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (5 Votes)

The code checks if the User is online or not. If he's online it will prompt a MsgBox "You are connected to the net.") or it will Show: "You are NOT connected to the net.". You can also insert your code. This code is useful when your application uses the internet. So if the user is not connected the net, the program will simply unload.

Rate Check if user is Online

Private Type RASCONN
  dwSize As Long
  hRasConn As Long
  szEntryName(256) As Byte
  szDeviceType(16) As Byte
  szDeviceName(128) As Byte
End Type
Private Declare Function RasEnumConnectionsA& Lib "RasApi32.DLL" (lprasconn As Any, lpcb&, lpcConnections&)
Private Sub Command1_Click()
Dim Verbindung As RASCONN
Dim size, Anz As Long
 Verbindung.dwSize = 412
 size = Verbindung.dwSize
 If RasEnumConnectionsA(Verbindung, size, Anz) = 0 Then
  If Anz = 0 Then
  MsgBox ("You are NOT connected to the net.")
  Else
  MsgBox ("You are connected to the net.")
  End If
 End If
End Sub

Download this snippet    Add to My Saved Code

Check if user is Online Comments

No comments have been posted about Check if user is Online. Why not be the first to post a comment about Check if user is Online.

Post your comment

Subject:
Message:
0/1000 characters