Code:
public Thread ThreadReceive;
ThreadReceive = New System.Threading.Thread(AddressOf ReceiveMessages)
ThreadReceive.Start()
Public Sub ReceiveMessages()
Try
Dim receiveBytes As [Byte]() = receivingUdpClient.Receive(RemoteIpEndPoint)
txtIP.Text = RemoteIpEndPoint.Address.ToString
Dim BitDet As BitArray
BitDet = New BitArray(receiveBytes)
Catch e As Exception
Console.WriteLine(e.Message)
End Try
End Sub
Can anyone Please Suggest me How to convert this line:
ThreadReceive = New System.Threading.Thread(AddressOf ReceiveMessages)
vb to C#
Thanks, Basha.
Assuming no name changes, this should work:
ThreadReceive = new System.Threading.Thread(receiveMessage);
AddressOf
creates a delegate to ReceiveMessages
and this is implied in C#.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With