Winsock Connect Function
Posted: Thu Oct 14, 2004 7:58 pm
Well I was tired of using my winsock to connect to different servers and writing 3 lines of code just to get the control to connect. So I made the following function:
* Note: This is used for Microsoft Winsock Control 6.0
Public Sub Connect(Server As String, Port As String)
With Winsock1
.RemoteHost = Server
.RemotePort = Port
.Connect
End With
End Sub
Syntax:
Connect "irc.killanet.net", "6667"
'This is just an example...
Remember to replace Winsock1 with your own named winsock control.
Such a simple code, but such a help in your coding /blum.gif' class='bbc_emoticon' alt=':P' />
~Dren (victory)
* Note: This is used for Microsoft Winsock Control 6.0
Public Sub Connect(Server As String, Port As String)
With Winsock1
.RemoteHost = Server
.RemotePort = Port
.Connect
End With
End Sub
Syntax:
Connect "irc.killanet.net", "6667"
'This is just an example...
Remember to replace Winsock1 with your own named winsock control.
Such a simple code, but such a help in your coding /blum.gif' class='bbc_emoticon' alt=':P' />
~Dren (victory)