c# - Protobuf 消息平台是否独立

标签 c# asp.net cordova protocol-buffers protobuf-net

我正在计划一个应用程序,其中服务器端将用 C# 编写,客户端将使用 phonegap 创建

该应用程序大量使用使用 protobuf-net 库序列化的二进制文件。

假设我在 C# 中有一个对象

public class Foo
{
   private string FooProp;
}

并且此对象被序列化并使用 phonegap 传输到客户端。甚至可以反序列化 phone gap 中生成的二进制文件并使用 Javascript 在 phonegap 中访问这些属性吗?

最佳答案

the Protocol Buffers documentation的第一句是:

Welcome to the developer documentation for protocol buffers – a language-neutral, platform-neutral, extensible way of serializing structured data for use in communications protocols, data storage, and more.

因此,是的,protobuf 是独立于平台的。

至于你是否可以从 JavaScript 使用 protobuf,我会告诉你 this question ,因为总体答案似乎是“仅通过第三方库”。您还可以在 the protobuf project site 上找到一些第三方库。 .

关于c# - Protobuf 消息平台是否独立,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18663051/

相关文章:

iphone - 在 iPhone 中使用 Phonegap 拨号

javascript - 如何从javascript返回值在android中设置变量

javascript - 即使在添加控制台插件后,console.log 在 iOS Phonegap App 中也不起作用

c# - 302 重定向仍在尝试运行原始请求

c# - 使用 c# 2010 express 连接到 oracle XE

c# - 如何生成局部变量?

c# - 不同分辨率下的 Windows 窗体大小问题

c# - HttpContext.Current.User.Identity.Name 如何知道存在哪些用户名?

c# - 什么是托管代码和非托管代码?

c# - 创建未设置为对象实例的 Outlook 应用程序对象引用