序列化:

Dictionary<string, string> sPara = GetRequestPost(ref parameterStr);

                string serializeString = JSONUtility.Serialize(sPara);
serializeString = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(serializeString));

反序列化:

System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding();
System.Text.Decoder utf8Decode = encoder.GetDecoder();
byte[] todecode_byte = Convert.FromBase64String(base64DataString);
int charCount = utf8Decode.GetCharCount(todecode_byte, , todecode_byte.Length);
char[] decoded_char = new char[charCount];
utf8Decode.GetChars(todecode_byte, , todecode_byte.Length, decoded_char, );
string decodeResult = new String(decoded_char);
Dictionary<string, string> sPara = JSONUtility.Deserialize<Dictionary<string, string>>(decodeResult);

主要用于httpPost协议传输数据。

最新文章

  1. DBImport v3.3 中文版发布:数据库数据互导及文档生成工具(IT人员必备)
  2. JS的递归与TCO尾调用优化
  3. iOS开发——项目需求-快速回到当前界面的顶部
  4. C#调用ArcGIS REST服务
  5. Redis_Jedis使用总结
  6. pycharm 常用设置
  7. 射频识别技术漫谈(6)&mdash;&mdash;通讯协议概述【worldsing笔记】
  8. How to read video frames in hadoop?如何在Hadoop中读取视频帧?
  9. asp.net js调用后台方法
  10. DescribingDesign Patterns 描述设计模式
  11. surface pro系统按键+重装系统
  12. linux sed命令就是这么简单
  13. Vulkan Tutorial 18 重构交换链
  14. linux安装lamp环境(linux+apache+mysql+php)
  15. EF设计模式之code first
  16. icpc2018-焦作-F Honeycomb bfs
  17. sublime text3 当运行报错error时,取消显示路径path的方法
  18. document.domain 跨域问题[转]
  19. 选股:“均线是水,K线是舟,量是马达!”的选美理念!
  20. AVR单片机命名规则

热门文章

  1. Spring的BeanFactory体系结构(一)
  2. Linux简介——(一)
  3. Linux 入门记录:五、vi、vim 编辑器
  4. 跟踪内核启动过程CONFIG_DEBUG_LL【转自】
  5. 实验室项目.md
  6. Cause: java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.ibatis.mapping.MappedStatement
  7. css3属性书写的时候带的一些前缀的意思
  8. ASP.NET Core Module overview模块概述
  9. LinkedList 源码分析
  10. vue css动画