专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > VB Dotnet

protobuf 的东西,完全整不明白了!解决办法

发布时间:2011-06-23 16:04:13 文章来源:www.iduyao.cn 采编人员:星星草
protobuf 的东西,完全整不明白了!急啊!!!!!!!!!!

  Dim rpcResponse As New GetPubKey.RpcResponse

  rpcResponse = ProtoBuf.Serializer.DeserializeWithLengthPrefix(Of RpcResponse)(Stream, ProtoBuf.PrefixStyle.Base128, Stream.Length)


  Console.WriteLine("收到了!" & rpcResponse.flag)//这里出错"未将对象引用设置到对象的实例。"

可是明明是有引用到实例了"Dim rpcResponse As New GetPubKey.RpcResponse"

谁能告诉我怎么操作protobuf,进行接口数据传递啊!!!!

------解决方案--------------------
ProtoBuf.Serializer.DeserializeWithLengthPrefix(Of RpcResponse)(Stream, ProtoBuf.PrefixStyle.Base128, Stream.Length)

为 Nothing
------解决方案--------------------
增加:
if rpcResponse is not Nothing then
Console.WriteLine("收到了!" & rpcResponse.flag)
end if
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: