参考资料
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);
}
}