Traditional Culture Encyclopedia - Weather inquiry - How to analyze JOSN obtained from weather forecast
How to analyze JOSN obtained from weather forecast
2) Parsing JSON strings (taking console programs as an example)
Use? System;
Use? System. Assemble. Generics;
Use? System. Linq
Use? System. Text;
Use? System. Web.script.serialization;
Namespace? Consolesson
{
///? & lt summary & gt
///? Objects represented by JSON
///? & lt/summary & gt;
Public? Class? Weather information
{
Public? String? City? {? get? Settings; ? }
Public? String? cityid? {? get? Settings; ? }
Public? String? Temporary workers? {? get? Settings; ? }
Public? String? WD? {? get? Settings; ? }
Public? String? WS? {? get? Settings; ? }
Public? String? SD? {? get? Settings; ? }
Public? String? WSE? {? get? Settings; ? }
Public? String? Time? {? get? Settings; ? }
Public? String? Israel radar? {? get? Settings; ? }
Public? String? Radar? {? get? Settings; ? }
Public? String? njd? {? get? Settings; ? }
Public? String? qy? {? get? Settings; ? }
}
Class? procedure
{
Static electricity Invalid? Main(string[]? Parameter)
{
//JSON string. Note: Delete from the original string? "Weather information":
String? json? =? @"{'city':' Nanjing',' city ID':'101','temp':' 26',' wd':' southeast wind',' ws' Israel':'
WeatherInfo? W? =? New? JavaScriptSerializer()。 Deserialize & WeatherInfo & gt (JSON);
}
}
}
- Previous article:Heroic deeds against Japan
- Next article:How far is it from Anxue Rugao to Zhoushan?
- Related articles
- Please provide the source of this cartoon picture and a detailed introduction to the characters. Please be more detailed.
- Thailand's cat is kept, and suddenly one day it is ugly. What should I do?
- How far is Jishi Mountain in Gansu from Longnan?
- Four words to describe the cold weather.
- Writing Guidance for Hutou Mountain in Shexian County to Describe Summer
- How to download the weather forecast in Qidong?
- Typhoon Haigao made landfall in Jinwan, Zhuhai. What is the instantaneous maximum wind force?
- Composition describing Huahu Lake in Mouding County 100 words
- Sentences describing clear skies
- Help me translate a few words of Japanese and mark them with Hiragana.