China Naming Network - Company naming - How to analyze JOSN obtained from weather forecast

How to analyze JOSN obtained from weather forecast

1) Add a reference to the project: System. Web. extension

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);

}

}

}