VB.net 代码 to C#!

passby12 2007-10-02 12:23:56
' 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的转换
...全文
60 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
277894613 2007-10-04
  • 打赏
  • 举报
回复
哈哈,干吗要转呢?联编到一起不就可以了
SDFDSAC 2007-10-02
  • 打赏
  • 举报
回复
我日,又不难....i服了you
waslee 2007-10-02
  • 打赏
  • 举报
回复
i服了you
passby12 2007-10-02
  • 打赏
  • 举报
回复
是不难啊,关键是RaiseEvent怎么转换成C#?
wangzi041 2007-10-02
  • 打赏
  • 举报
回复
RaiseEvent
转换的时候删掉就行了!
VB.NET 和C# 的事件处理的方法是不一样的!
SDFDSAC 2007-10-02
  • 打赏
  • 举报
回复
http://www.ellkay.com/ConvertVB2Csharp_demo.htm

110,571

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧