Tools Links Login

Check Connection

This code will check if a connection is opened to the internet , if not , it will show a messagebox ! easy ... i like this way because am a new programmer!!!

Original Author: DXB700

Assumptions


1- Add mswinsck.ocx to the form
2- Add a command button to the form (Caption = Detect)
3- Add a text box to the form (Visible = false)
4- Copy Code !!

Code

Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox "No Connnection!"
Else
MsgBox "Connection Detected"
End If
End Sub
Private Sub Form_Load()
Text1.Text = Winsock1.LocalIP

End Sub
'Easy ha ? .. This is the way i like it !!

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 88 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.