Protected void Page_Load (object sender, EventArgs e) {List
StudentNames = new List
(); StudentNames. add ("John"); studentNames. add ("Mary"); studentNames. add ("Rose"); // display each element foreach (string item in studentNames) {Response. write (item); Response. write ("
");} Response. Write ("
"); // Convert the List to string studentAllName = string. join (",", studentNames. toArray (); Response. write (studentAllName); Response. write ("
"); List
StudentScore = new List
(); StudentScore. add (100); studentScore. add (98); studentScore. add (59); // sort studentScore. sort (); // reverse Sort studentScore. reverse (); // display each element foreach (decimal score in studentScore) {Response. write (score); Response. write ("
");} // Total SUM Response. Write (" total score "+ studentScore. Sum (); Response. Write ("
"); // List whether there is Response. Write (studentScore. Exists (MatchPRE); Response. Write ("
"); // Convert List to JSon List
List = new List
(); For (int I = 0; I <5; I ++) {Student a = new Student ();. name = "Zhang San" + I;. age = I;. sex = "male"; list. add (a);} string json = new System. web. script. serialization. javaScriptSerializer (). serialize (list); Response. write (json); Response. write ("
");} Private static bool MatchPRE (decimal p) // condition matching function. Each element in list1 will be input to P. // after matching, the function returns {if (p = 100) // This sentence is a matching condition. If a match is returned, you can change it to the desired value return true; else {return false ;}} public struct Student {public string Name; public int Age; public string Sex ;}