I am trying to create a program what checks that my pop3 server is still running, using Winsocket.
Has anyone got any better ways of doing it or sugestions.
Printable View
I am trying to create a program what checks that my pop3 server is still running, using Winsocket.
Has anyone got any better ways of doing it or sugestions.
thats easy, use the winsock control, project>compnants>microsoft winsock control. add a button and winsock to the form and put:
VB Code:
Private Sub Command1_Click() Winsock1.Close Winsock1.Connect "pop.tiscali.co.uk", 110 End Sub Private Sub Winsock1_Close() Winsock1.Close MsgBox "Server terminated the connection" End Sub Private Sub Winsock1_Connect() Winsock1.Close MsgBox "The server is alive" End Sub Private Sub Winsock1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean) Winsock1.Close MsgBox "Server is down" End Sub
Click the button to check if the server is alive or not
thanks for that