Private Sub button2_Click(sender As Object, e As EventArgs)
Dim j As Integer
Dim bs As Byte() = New Byte(1023){}
If statusBar1.Text = "Idle" Then
MessageBox.Show("Not connected to PS2!")
Return
End If
server.Send(Encoding.ASCII.GetBytes("SEND_CODES!"))
Dim strs1 As String() = Regex.Split(codelines.Text, Chr(13) & Chr(10))
For j = 0 To CInt(strs1.Length) - 1
Dim str2 As String = strs1(j)
If Regex.IsMatch(str2, "^[0-9a-fA-F]{8} [0-9a-fA-F]{8}$") Then
Dim k As Integer
Dim strs2 As String() = Regex.Split(str2, " +")
For k = 0 To CInt(strs2.Length) - 1
Dim str3 As String = strs2(k)
server.Send(Encoding.ASCII.GetBytes(str3))
server.Send(Encoding.ASCII.GetBytes("%"))
Next k
ElseIf str2 = "" Then
server.Send(Encoding.ASCII.GetBytes("@"))
End If
Next j
server.Send(Encoding.ASCII.GetBytes("!"))
Dim i As Integer = server.Receive(bs)
MessageBox.Show(Encoding.ASCII.GetString(bs, 0, i))
End Sub
How can i create a usable code that performs the same actions?