The server side can be implemented using. net, just use the most common web form. aspx.
1. New item default. aspx
Add the following code to default. aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><asp:literal id="lt_rtn" runat="server"></asp:literal>
2. Go to the default. aspx. CS file.
Add the following code to the page_load method:
Student [] students = new student [4]; students [0] = new student (); students [1] = new student (); students [2] = new student (); students [3] = new student (); students [0]. number = "000000"; students [0]. name = "Kevin"; students [0]. sex = "male"; students [0]. age = "23"; students [1]. number = "111111"; students [1]. name = "Tom"; students [1]. sex = "male"; students [1]. age = "23"; students [2]. number = "222222"; students [2]. name = "Lily"; students [2]. sex = "female"; students [2]. age = "22"; students [3]. number = "333333"; students [3]. name = "John"; students [3]. sex = "male"; students [3]. age = "24"; javascriptserializer JS = new javascriptserializer (); lt_rtn.text = Js. serialize (students );
Create a new student class to encapsulate information. The Code is as follows:
public class Student{ public Student() { } public string number; public string name; public string age; public string sex;}
3. Run the experiment to check whether the webpage displays a JSON string. If it is displayed, the experiment is successful.
This article is learned from this great god. You can refer to this great god's blog. He introduced the knowledge of interaction between mobile terminals and servers.
Transport: http://www.cnblogs.com/flashpig/archive/2011/12/10/2283357.html