Showing posts with label WinSock. Show all posts
Showing posts with label WinSock. Show all posts

Menampilkan Icon Network (Winsock)

Di dalam suatu program network tentu kita perlu mengetahui apakah computer kita sudah terkoneksi dengan komputer lain?. Berikut ini contoh program menampilkan icon koneksi dengan komponen winsock.
Option Explicit
Private Sub Form_Load()
    If OnTheNet Then
        lblConnectInfo.Caption = "Connected"
    Else
        lblConnectInfo.Caption = "Not connected"
    End If
End Sub
Private Function OnTheNet() As Boolean
    Winsock1.Close
    Winsock1.Bind
    If Winsock1.LocalIP = "" Then
        OnTheNet = False
    Else
        OnTheNet = True
    End If
End Function

About Me

Followers

Home | Profile | Blogger | Template