Dim Insim(23) As Byte
BitConverter.GetBytes(ISI(3) = vbNullChar).CopyTo(Insim, 3)
Dim port As UInt16
[LEFT]BitConverter.GetBytes(ISI(0) = "I").CopyTo(Insim, 0)[/LEFT]
Dim udp As New UdpClient
Dim ISI(4) As Char
Dim admin(16) As Char
Dim port As String
Dim flags As Byte
Dim NodeSecs As Byte
Dim ip As IPEndPoint
Dim Insim(13) As Byte
Public Sub InSimInit()
BitConverter.GetBytes(ISI(0) = "I").CopyTo(Insim, 0)
BitConverter.GetBytes(ISI(1) = "S").CopyTo(Insim, 1)
BitConverter.GetBytes(ISI(2) = "I").CopyTo(Insim, 2)
BitConverter.GetBytes(ISI(3) = ChrW(0)).CopyTo(Insim, 3)
BitConverter.GetBytes(port = 30001).CopyTo(Insim, 6)
BitConverter.GetBytes(flags = (16)).CopyTo(Insim, 5)
BitConverter.GetBytes(NodeSecs = 0).CopyTo(Insim, 4)
BitConverter.GetBytes(admin(0) = "T").CopyTo(Insim, 7)
BitConverter.GetBytes(admin(1) = "E").CopyTo(Insim, 8)
BitConverter.GetBytes(admin(2) = "S").CopyTo(Insim, 9)
BitConverter.GetBytes(admin(3) = "T").CopyTo(Insim, 10)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
InSimInit()
udp.Connect("127.0.0.1", 30001)
For i As Integer = 0 To 10
udp.Send(Insim, i)
'Stop
Next i
End Sub
Dim ISI(4) As Char
Dim admin(16) As Char
Dim port As String
Dim flags As Byte
Dim NodeSecs(2) As Byte
Dim ip As IPEndPoint
Dim sock As New UdpClient
Dim insim(13) As Byte
Public Sub InSimInit()
BitConverter.GetBytes(ISI(0) = "I").CopyTo(insim, 0)
BitConverter.GetBytes(ISI(1) = "S").CopyTo(insim, 1)
BitConverter.GetBytes(ISI(2) = "I").CopyTo(insim, 2)
BitConverter.GetBytes(ISI(3) = ChrW(0)).CopyTo(insim, 3)
BitConverter.GetBytes(NodeSecs(0) = 0).CopyTo(insim, 4)
BitConverter.GetBytes(flags = (16)).CopyTo(insim, 5)
BitConverter.GetBytes(port = 29999).CopyTo(insim, 6)
BitConverter.GetBytes(admin(0) = "T").CopyTo(insim, 7)
BitConverter.GetBytes(admin(1) = "E").CopyTo(insim, 8)
BitConverter.GetBytes(admin(2) = "S").CopyTo(insim, 9)
BitConverter.GetBytes(admin(3) = "T").CopyTo(insim, 10)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
InSimInit()
sock.Send(insim, 13)
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
sock.Connect("127.0.0.1", 29999)
End Sub
Dim ISI(4) As Char
Dim admin(16) As Char
Dim port As String
Dim flags As Byte
Dim isiports(6) As Byte
Dim NodeSecs As Byte
Public Sub InSimInit()
ISI(0) = "I"
ISI(1) = "S"
ISI(2) = "I"
ISI(3) = ChrW(0)
NodeSecs = 0
flags = (16)
port = 12345
admin(0) = "T"
admin(1) = "E"
admin(2) = "S"
admin(3) = "T"
End Sub
Dim Bytes(4) As Char
Dim NodeSecs(1) As Byte
Bytes(0) = "I"
Bytes(1) = "S"
Bytes(2) = "I"
Bytes(3) = ChrW(0)
NodeSecs(0) = 0
NodeSecs(1) = 0
Winsock1.Connect("127.0.1", 29999)
Winsock1.Send(Bytes)
Winsock1.RemotePort = (29998)