zoukankan      html  css  js  c++  java
  • [h5棋牌项目]-18-C#读取json文件

    参考资料

    c# 解析读取JSON文件 https://www.cnblogs.com/xiejunzhao/p/728222f170868b207bba1dcefae4a93f.html

    ConfigIB.json

    {
    	"url":"https://www.7366h.com/SportsFt/resultData",
    	"postdata":"queryDatetime=2019-08-13&page=1&__RequestVerificationToken=Up5n6T1jQuFXWQFljh85e_4s3nNfeJZJHvNK3vm5cxHWQ_eTrZ5963mpUqDY3xl6v8MQjSBvdU2fBVi7kejtfN2l2RZjWgl0Zr22QIyUpzPwQM1GzAggbyNEutgchXjFzCkPdcrJoVK1_6zaXS9fO1t-NArJAOgAstD0kZtBpQ81",
    	"cookies":"ASP.NET_SessionId=lliszh3bypgbygmafpjlrhz5; __RequestVerificationToken=QNFr4sniyRkUacXuUceOAyINcMZl2CCRyetng8vp9Q70davZmbYKp09EzzQArJzHhxbNh89UWLZ-3JUduorBhMl9PbLR7tvpL31JVuI00zNLd-eR9heHfuzAO09zVkUmxzgnsMh7IFvXSO9eInr9DQ2"
    }
    static void Main(string[] args)
    {
    	//Class1 test = new Class1();
    	//string url = "https://www.7366h.com/SportsFt/resultData";
    	//string postdata = "queryDatetime=2019-08-13&page=1&__RequestVerificationToken=Up5n6T1jQuFXWQFljh85e_4s3nNfeJZJHvNK3vm5cxHWQ_eTrZ5963mpUqDY3xl6v8MQjSBvdU2fBVi7kejtfN2l2RZjWgl0Zr22QIyUpzPwQM1GzAggbyNEutgchXjFzCkPdcrJoVK1_6zaXS9fO1t-NArJAOgAstD0kZtBpQ81";
    	//string cookies = "ASP.NET_SessionId=lliszh3bypgbygmafpjlrhz5; __RequestVerificationToken=QNFr4sniyRkUacXuUceOAyINcMZl2CCRyetng8vp9Q70davZmbYKp09EzzQArJzHhxbNh89UWLZ-3JUduorBhMl9PbLR7tvpL31JVuI00zNLd-eR9heHfuzAO09zVkUmxzgnsMh7IFvXSO9eInr9DQ2";
    	//加载配置
    	string strReadFilePath = @"ConfigIB.json";
    	StreamReader srReadFile = new StreamReader(strReadFilePath);
    	string jsonText = "";
    	while (!srReadFile.EndOfStream) {
    		jsonText += srReadFile.ReadLine();
    	}
    	JObject jo = (JObject)JsonConvert.DeserializeObject(jsonText);
    	string url = jo.GetValue("url").ToString();
    	string postdata = jo.GetValue("postdata").ToString();
    	string cookies = jo.GetValue("cookies").ToString();
    	foreach (var i in jo.Values()) {
    		Console.WriteLine(i);
    	}
    }
  • 相关阅读:
    ansible源码解读
    python标准模块(下)
    python学习之算法、自定义模块、系统标准模块(上)
    pathon 基础学习-集合(set),单双队列,深浅copy,内置函数
    python的map,filter,reduce学习
    python 列表
    python生成器、装饰器、正则
    python 模块学习
    python基础学习(一)--数据类型
    时间复杂度的计算
  • 原文地址:https://www.cnblogs.com/byfei/p/14104136.html
Copyright © 2011-2022 走看看