VB.net 代码 to C#!
' Events
Protected Event GetMsgEvent(ByVal vstrMsg As String)
...
Protected Function GetMsg() As String
If sckSocket.Connected Then
Static strMsgBuffer As String = ""
' Get the byte cound and de
Dim BytesGot As Integer = sckSocket.Receive(arrBuffer, arrBuffer.Length, SocketFlags.None)
' Check data was returned
If BytesGot > 0 Then
' Retreive the next set of bytes
RaiseEvent GetMsgEvent(Encoding.ASCII.GetString(arrBuffer, 0, BytesGot))
' Return the buffer as a string
Return Encoding.ASCII.GetString(arrBuffer, 0, BytesGot)
End If
End If
Return ""
End Function
...
麻烦帮我转换一下,最主要是RaiseEvent的转换