Json is a data format specially designed for webpage special effect code running on a webpage in a browser. There are more and more scenarios for using json in website applications. This article introduces the asp tutorial. net json serialization and deserialization, mainly a brief introduction to json, asp.net tutorial on how to serialize and deserialize, processing of date, set, and dictionary in serialization and deserialization.
1. Introduction to json
Json (javascript object notation, javascript object notation) is a lightweight data exchange format.
Json is a set of "name-value pairs. The structure consists of braces '{}', braces '[]', comma ',', colons ':', and double quotation marks '. The data types include object, number, boolean, string, array, and null.
Json has the following forms:
An object is an unordered set of "name-value pairs". An object starts with "{" and ends. Each "name" is followed by one ":". Multiple "name-value pairs" are separated by commas. For example:
Var user = {"name": "Zhang San", "gender": "male", "birthday": "1980-8-8 "}
An array is an ordered set of values. An array starts with "[" and ends with "]" and is separated. For example:
Var userlist = [{"user": {"name": "Zhang San", "gender": "male", "birthday": "1980-8-8 "}}, {"user": {"name": "", "gender": "male", "birthday": "1985-5-8"}];
A string is a collection of any number of unicode characters enclosed by double quotes. It is escaped using a backslash.
1 2 3 4