Pliz帮助,我将此代码从C#覆盖到了vb.net,但它一直给我错误 [英] Pliz help ,i coverted this code from c# to vb.net but it keeps giving me errors
本文介绍了Pliz帮助,我将此代码从C#覆盖到了vb.net,但它一直给我错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
错误表明未为类型定义运算符"<>"
the errors says "Operator ''<>'' is not defined for types"
For Each clientSend As SocketCoderClient In ClientsList
If client <> clientSend Then
Try
clientSend.ReadOnlySocket.Send(aryRet)
Catch
clientSend.ReadOnlySocket.Close()
ClientsList.Remove(client)
Return
End Try
End If
OP的其他信息从下面的非解决方案中移出
OP''s additional information moved from non-solution below
Error 2 Operator '<>' is not defined for types 'testvoice_server.SocketCoder.SocketCoderBinaryServer.SocketCoderClient' and 'testvoice_server.SocketCoder.SocketCoderBinaryServer.SocketCoderClient'
这是整个错误消息
this the whole error message
推荐答案
HI用Isnot
替换<>"
因为<>"不能用于在Vb.net中比较引用对象的实例.
HI Replace ''<>'' by Isnot
because ''<>'' can''t be use to compare instance of reference object in Vb.net
非常感谢,代码运行良好!
thanks a lot, code worked perfectly!
这不是整个错误消息.但这意味着,它无法比较client和clientSend,它们没有运算符可以比较.他们是同一类型吗?尝试向我们提供完整的确切错误消息.
That''s not the whole error message. But what it means is, it can''t compare client and clientSend, they don''t have an operator to compare. Are they the same type ? Try giving us the whole, exact error message.
这篇关于Pliz帮助,我将此代码从C#覆盖到了vb.net,但它一直给我错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文