Hi
I want to convert following code which is VB6 to Vb.Net.Could anybody can do it?
Private Sub Form_Load()
Winsock1.Protocol = sckUDPProtocol
Winsock1.RemoteHost = "192.168.1.100"
Winsock1.RemotePort = 6000
End Sub
Private Sub Timer_OFF_Click()
Timer1.Enabled = False
End Sub
Private Sub Timer_ON_Click()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Dim s1 As String
s1 = Chr(2) + Chr(0) + Chr(2) + Chr(49) + Chr(82) + Chr(97) + Chr$(26)
Winsock1.SendData s1
Debug.Print ("send 2 \n")
Winsock1.Close
Winsock1.Bind (6000)
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim a
Winsock1.GetData a
buffer = StrConv(a, vbUnicode)
For i = 1 To Len(buffer)
shex = shex & Hex(Asc(Mid$(buffer, i, 1))) & " "
Next i
If Trim(shex) <> "21111" Then
Winsock1.SendData Chr(2)
Winsock1.SendData Chr(0)
Winsock1.SendData Chr(2)
Winsock1.SendData Chr(50)
Winsock1.SendData Chr(147)
Winsock1.SendData Chr(163)
End If
List1.Clear
List1.AddItem shex
End Sub
Thanks
I want to convert following code which is VB6 to Vb.Net.Could anybody can do it?
Private Sub Form_Load()
Winsock1.Protocol = sckUDPProtocol
Winsock1.RemoteHost = "192.168.1.100"
Winsock1.RemotePort = 6000
End Sub
Private Sub Timer_OFF_Click()
Timer1.Enabled = False
End Sub
Private Sub Timer_ON_Click()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Dim s1 As String
s1 = Chr(2) + Chr(0) + Chr(2) + Chr(49) + Chr(82) + Chr(97) + Chr$(26)
Winsock1.SendData s1
Debug.Print ("send 2 \n")
Winsock1.Close
Winsock1.Bind (6000)
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim a
Winsock1.GetData a
buffer = StrConv(a, vbUnicode)
For i = 1 To Len(buffer)
shex = shex & Hex(Asc(Mid$(buffer, i, 1))) & " "
Next i
If Trim(shex) <> "21111" Then
Winsock1.SendData Chr(2)
Winsock1.SendData Chr(0)
Winsock1.SendData Chr(2)
Winsock1.SendData Chr(50)
Winsock1.SendData Chr(147)
Winsock1.SendData Chr(163)
End If
List1.Clear
List1.AddItem shex
End Sub
Thanks