当前位置: 首页 > news >正文

asp网站gzip压缩扬中网站建设机构

asp网站gzip压缩,扬中网站建设机构,wordpress搭建本地博客,微信代运营合同序列化是指将对象转换为可存储或传输的格式#xff0c;例如将对象转换为JSON字符串或字节流。反序列化则是将存储或传输的数据转换回对象的过程。这两个过程在数据持久化、数据交换以及与外部系统的通信中非常常见 把对象转换成josn字符串格式 这个过程就是序列化 josn字符…序列化是指将对象转换为可存储或传输的格式例如将对象转换为JSON字符串或字节流。反序列化则是将存储或传输的数据转换回对象的过程。这两个过程在数据持久化、数据交换以及与外部系统的通信中非常常见 把对象转换成josn字符串格式    这个过程就是序列化 josn字符串: 就是拥有固定格式的字符串 { name: 张三, age: 25, isStudent: true } 步骤: 1.在引用上右键 2.添加Nuget程序包 3.搜索json 4.点击下载Newtonsoft.json 5.在项目using  Newtonsoft.json 先声明两个类 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;namespace 序列反序列.Models {[Serializable]//表示这个类可以序列化internal class User{public int Id { get; set; }public string Name { get; set; }public string Email { get; set; }public string Password { get; set; }} }using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;namespace 序列反序列.Models {internal class Product{public int Id { get; set; }public string Name { get; set; }public string Description { get; set; }public float Price { get; set; }public User SaleUser { get; set; }} }using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using 序列反序列.Models; using Newtonsoft.Json;namespace 序列反序列 {/// summary/// MainWindow.xaml 的交互逻辑/// /summarypublic partial class MainWindow : Window{public MainWindow(){InitializeComponent();}string sstring.Empty;private void button1_Click(object sender, RoutedEventArgs e){Console.ForegroundColor ConsoleColor.Red;User user new User() { Id 1 , Name 小张 ,Email163.com,Password123566};sJsonConvert.SerializeObject(user);Console.WriteLine(s);Console.WriteLine(这上面是序列化的);}private void Button_Click(object sender, RoutedEventArgs e){if (!string.IsNullOrWhiteSpace(s)){User newUser JsonConvert.DeserializeObjectUser(s);Console.WriteLine(newUser.Name);}else{Console.WriteLine(先序列化);}}} }序列化 Console.ForegroundColor ConsoleColor.Red;User user new User() { Id 1 , Name 小张 ,Email163.com,Password123566};sJsonConvert.SerializeObject(user);Console.WriteLine(s);Console.WriteLine(这上面是序列化的); 反序列化 if (!string.IsNullOrWhiteSpace(s)){User newUser JsonConvert.DeserializeObjectUser(s);Console.WriteLine(newUser.Name);}else{Console.WriteLine(先序列化);} 效果 对象嵌套序列化 Product product new Product() {Id 1,Name 小明,Description 小明有一个狗,Price 1000.123f,SaleUser new User { Name 小兰, Id 2 } };string s JsonConvert.SerializeObject(product, Formatting.Indented); Console.WriteLine(s); Product product1 JsonConvert.DeserializeObjectProduct(s); Console.WriteLine(product1.Name); Console.WriteLine(product1.SaleUser.Name); 数组序列化 User user1 new User(){Id 1,Name 小丑,Email 168qq.com,Password 1452};User user2 new User() { Id 2, Name 效率, Email 9999qq.com, Password 246810 };object[] objs { user1, user2, true, 不知道 };s2 JsonConvert.SerializeObject(objs, Formatting.Indented);Console.WriteLine(s2); 数组反序列化 if (!string.IsNullOrWhiteSpace(s2)){object[] objs JsonConvert.DeserializeObjectobject[](s2);Console.WriteLine(objs[1]);//字符串User u JsonConvert.DeserializeObjectUser(objs[1].ToString());Console.WriteLine(u.Name);} 效果
文章转载自:
http://www.morning.zqdhr.cn.gov.cn.zqdhr.cn
http://www.morning.sqlh.cn.gov.cn.sqlh.cn
http://www.morning.ysdwq.cn.gov.cn.ysdwq.cn
http://www.morning.wmdbn.cn.gov.cn.wmdbn.cn
http://www.morning.httpm.cn.gov.cn.httpm.cn
http://www.morning.hrydl.cn.gov.cn.hrydl.cn
http://www.morning.rtjhw.cn.gov.cn.rtjhw.cn
http://www.morning.ldwxj.cn.gov.cn.ldwxj.cn
http://www.morning.wnhsw.cn.gov.cn.wnhsw.cn
http://www.morning.rksnk.cn.gov.cn.rksnk.cn
http://www.morning.bpmz.cn.gov.cn.bpmz.cn
http://www.morning.yjfzk.cn.gov.cn.yjfzk.cn
http://www.morning.ljzss.cn.gov.cn.ljzss.cn
http://www.morning.htjwz.cn.gov.cn.htjwz.cn
http://www.morning.kmrgl.cn.gov.cn.kmrgl.cn
http://www.morning.llthz.cn.gov.cn.llthz.cn
http://www.morning.zsyrk.cn.gov.cn.zsyrk.cn
http://www.morning.tkcct.cn.gov.cn.tkcct.cn
http://www.morning.mmqhq.cn.gov.cn.mmqhq.cn
http://www.morning.bojkosvit.com.gov.cn.bojkosvit.com
http://www.morning.qsy36.cn.gov.cn.qsy36.cn
http://www.morning.homayy.com.gov.cn.homayy.com
http://www.morning.rynq.cn.gov.cn.rynq.cn
http://www.morning.zdfrg.cn.gov.cn.zdfrg.cn
http://www.morning.fmry.cn.gov.cn.fmry.cn
http://www.morning.nsjpz.cn.gov.cn.nsjpz.cn
http://www.morning.qpsdq.cn.gov.cn.qpsdq.cn
http://www.morning.cwyrp.cn.gov.cn.cwyrp.cn
http://www.morning.ytfr.cn.gov.cn.ytfr.cn
http://www.morning.yprjy.cn.gov.cn.yprjy.cn
http://www.morning.rcgzg.cn.gov.cn.rcgzg.cn
http://www.morning.zcsch.cn.gov.cn.zcsch.cn
http://www.morning.clyhq.cn.gov.cn.clyhq.cn
http://www.morning.knmby.cn.gov.cn.knmby.cn
http://www.morning.lhsdf.cn.gov.cn.lhsdf.cn
http://www.morning.clybn.cn.gov.cn.clybn.cn
http://www.morning.supera.com.cn.gov.cn.supera.com.cn
http://www.morning.bzfwn.cn.gov.cn.bzfwn.cn
http://www.morning.hhfqk.cn.gov.cn.hhfqk.cn
http://www.morning.xlyt.cn.gov.cn.xlyt.cn
http://www.morning.qnzld.cn.gov.cn.qnzld.cn
http://www.morning.gbnsq.cn.gov.cn.gbnsq.cn
http://www.morning.lqchz.cn.gov.cn.lqchz.cn
http://www.morning.bfjyp.cn.gov.cn.bfjyp.cn
http://www.morning.nhdmh.cn.gov.cn.nhdmh.cn
http://www.morning.xznrk.cn.gov.cn.xznrk.cn
http://www.morning.lsqxh.cn.gov.cn.lsqxh.cn
http://www.morning.flqkp.cn.gov.cn.flqkp.cn
http://www.morning.rongxiaoman.com.gov.cn.rongxiaoman.com
http://www.morning.qkgwz.cn.gov.cn.qkgwz.cn
http://www.morning.whothehellami.com.gov.cn.whothehellami.com
http://www.morning.xfcjs.cn.gov.cn.xfcjs.cn
http://www.morning.dfmjm.cn.gov.cn.dfmjm.cn
http://www.morning.yqpzl.cn.gov.cn.yqpzl.cn
http://www.morning.kldtf.cn.gov.cn.kldtf.cn
http://www.morning.wmgjq.cn.gov.cn.wmgjq.cn
http://www.morning.skbkq.cn.gov.cn.skbkq.cn
http://www.morning.nfzw.cn.gov.cn.nfzw.cn
http://www.morning.cxtbh.cn.gov.cn.cxtbh.cn
http://www.morning.kxnnh.cn.gov.cn.kxnnh.cn
http://www.morning.qngcq.cn.gov.cn.qngcq.cn
http://www.morning.sjwzz.cn.gov.cn.sjwzz.cn
http://www.morning.xxiobql.cn.gov.cn.xxiobql.cn
http://www.morning.bwxph.cn.gov.cn.bwxph.cn
http://www.morning.hkchp.cn.gov.cn.hkchp.cn
http://www.morning.rwdbz.cn.gov.cn.rwdbz.cn
http://www.morning.gbcxb.cn.gov.cn.gbcxb.cn
http://www.morning.mqfhy.cn.gov.cn.mqfhy.cn
http://www.morning.cjqcx.cn.gov.cn.cjqcx.cn
http://www.morning.mttqp.cn.gov.cn.mttqp.cn
http://www.morning.smszt.com.gov.cn.smszt.com
http://www.morning.prysb.cn.gov.cn.prysb.cn
http://www.morning.gsdbg.cn.gov.cn.gsdbg.cn
http://www.morning.dpwcl.cn.gov.cn.dpwcl.cn
http://www.morning.kpygy.cn.gov.cn.kpygy.cn
http://www.morning.jcjgh.cn.gov.cn.jcjgh.cn
http://www.morning.mnbcj.cn.gov.cn.mnbcj.cn
http://www.morning.wbrf.cn.gov.cn.wbrf.cn
http://www.morning.ldqrd.cn.gov.cn.ldqrd.cn
http://www.morning.gqfjb.cn.gov.cn.gqfjb.cn
http://www.tj-hxxt.cn/news/235472.html

相关文章:

  • 回老家做PHP网站电子政务门户网站建设代码
  • 在学做网站还不知道买什么好免费注册个网站
  • 建设网站是普通办公吗如何创建一个官网
  • 福田网站建设论文结论个人做网站设计
  • 网站建设必须配置建设部网站四库一平台
  • 浙江华企网站做的咋样便宜网站建设 优帮云
  • 关于做芯片类招聘的网站服务器IP做网址打开网站
  • 网站风格下载html编辑器的推荐
  • 免费网址导航网站建设网络营销课程总结
  • 专业制作企业网站万网网站备案证书
  • 学校网站维护怎么做建设银行网站上改手机号码
  • 专业的企业网站优化公司网站新开怎么做营销
  • 竭诚网络网站建设烟台h5响应式网站建设
  • 南谯区城乡建设局网站网站可以做动画轮播吗
  • 网站建设对接模版建设企业网银交易密码是什么
  • 临安建设工程规划公示网站网站建设服务合同要交印花税吗
  • 源码网站永久免费会员管理系统
  • wordpress 交流哈尔滨服务最好的网站优化公司
  • 广州市住宅建设发展有限公司网站阿里巴巴开店网站怎么做
  • 有没有专业做特产的网站全国货运信息网配货
  • 蚌埠做网站哪家好12306网站做的好还是百度做的好
  • 如何做英文ppt模板下载网站网站经营网络备案信息
  • 建设seo网站免费建站平台0
  • 武昌做网站哪家好做微信公众号的网站吗
  • php网站开发工程师招聘网营销推广的特点
  • 肃宁县网站建设价格深圳龙华区发达吗
  • 平面设计班襄阳seo研究中心
  • 网站策划方案ppt网络公关公司联系方式
  • 科技公司网站建设策划方案网站维护和制作怎么做会计分录
  • 网站微信二维码侧边栏漂浮框常州制作网站信息