C#相当于VB.Net AddressOf Operator

前端之家收集整理的这篇文章主要介绍了C#相当于VB.Net AddressOf Operator前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
码:
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

任何人都可以建议我如何转换这一行:

ThreadReceive = New System.Threading.Thread(AddressOf ReceiveMessages)

vb到C#

谢谢,
岜沙.

解决方法

假设没有名称更改,这应该工作:
ThreadReceive = new System.Threading.Thread(receiveMessage);

AddressOf创建ReceiveMessages的委托,这在C#中暗示.

猜你在找的C#相关文章