-
Notifications
You must be signed in to change notification settings - Fork 2
/
JsonStrDeal.cs
70 lines (67 loc) · 1.93 KB
/
JsonStrDeal.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace GetPost
{
//报文结构状态
public class JsonInfo
{
public DateTime time { get; set; }
public CityInfo cityinfo { get; set; }
public string date { get; set; }
public string message { get; set; }
public string status { get; set; }
public Data data { get; set; }
}
#region 详细数据
//城市信息
public class CityInfo
{
public string city { get; set; }
public string cityId { get; set; }
public string parent { get; set; }
public string upadataTime { get; set; }
}
//今天信息
public class Data
{
public string shidu { get; set; }
public string pm25 { get; set; }
public string pm10 { get; set; }
public string quality { get; set; }
public string wendu { get; set; }
public string ganmao { get; set; }
public WeatherData yesterday { get; set; }
public List<WeatherData> forecast { get; set; }
}
//预测信息
public class WeatherData
{
public string date { get; set; }
public string sunrise { get; set; }
public string high { get; set; }
public string low { get; set; }
//空气污染指数
public string aqi { get; set; }
public DateTime ymd { get; set; }
public string week { get; set; }
//风向
public string fx { get; set; }
//风级
public string fl { get; set; }
//天气
public string type { get; set; }
//提醒
public string notice { get; set; }
}
#endregion
public class JsonStrDel
{
public JsonInfo WeatherMessage;
public void DataDel(string jsonMessage )
{
//反序列化
WeatherMessage=JsonConvert.DeserializeObject<JsonInfo>(jsonMessage);
}
}
}