读书人

protobuf 的东西完全整不明白了!解

发布时间: 2012-01-24 23:11:54 作者: rapoo

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

读书人网 >VB Dotnet

热点推荐