请选择 进入手机版 | 继续访问电脑版

大润晟泽博客

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 610|回复: 0

protobuf编译工具protoc编译生成c#

[复制链接]

16万

主题

16万

帖子

49万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
493071
发表于 2022-9-19 17:54:26 | 显示全部楼层 |阅读模式
我用的编译工具是protoc
编译的文件为kuaishou1.proto
内容为:
  1. // [START declaration]
  2. syntax = "proto3";
  3. package tutorial;


  4. // [END declaration]



  5. // [START csharp_declaration]
  6. option csharp_namespace = "Google.Protobuf.Examples.AddressBook";
  7. // [END csharp_declaration]

  8. // [START messages]
  9. message Person {
  10.   string liveStreamId = 1;
  11.    string pageld = 2;
  12.   string token = 3;


  13. }

  14. // [END messages]
复制代码
添加程序bin目录为环境变量path,
执行cmd
在命令行输入命令
  1. protoc -I=C:\test --csharp_out=C:\test\ kuaishou1.proto
复制代码
注意kuaishou1.proto文件名前面有一个空格。其他只填目录




上一篇:群控手机代码调试日志
下一篇:0037130930229223006:true
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|大润晟泽博客 ( 鲁ICP备17022854号-3 )

GMT+8, 2024-3-29 13:09 , Processed in 0.073438 second(s), 23 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表