Beginners Intro To IRC Connections
Shows Begineers how to sucessfully program applications to connect to IRC servers.
AI
สรุปโดย AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
ซอร์สโค้ด
' This code shows the basic way too make ' a basic connection to an irc server and ' keep it alive 'Requires: 1 textbox with multiline enabled ' 1 Winsock Control Private Sub Form_Load() ' Connect the winsock to the irc server Winsock1.Close Winsock1.Connect "irc.qeast.net", 6667 '(6667 is the default irc port) End Sub Private Sub Winsock1_Connect() 'When a user connects to an irc server, such programs 'like mirc, automaticly send over your Nick and User 'So when the winsock is connected we will do the same With Winsock1 .SendData "NICK psc-user" & vbCrLf .SendData "USER pscode pscode pscode pscode" & vbCrLf End With End Sub Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long) 'First we declare a variable for the data to go in Dim data As String Dim reply As String 'Now get the data and put it in the variable Data Winsock1.GetData data 'Put the data in text1 Text1.Text = Text1.Text & data 'if the data is a ping from the server we must reply 'with a PONG then the rest of the ping 'eg. PING :12345 would be replied with PONG :12345 If Left(UCase(data), 4) = "PING" Then 'extract what we have to pong back and send it reply = Right(data, Len(data) - 6) Winsock1.SendData "PONG :" & reply End If End Sub 'End of code
ความคิดเห็นดั้งเดิม (3)
กู้คืนจาก Wayback Machine