永发信息网

.net 怎么生成json文件啊?求种子

答案:3  悬赏:0  手机版
解决时间 2021-05-02 11:47
  • 提问者网友:爱了却不能说
  • 2021-05-02 08:34

要有码的哦,谢谢了!

最佳答案
  • 五星知识达人网友:西岸风
  • 2021-05-02 09:13

http://www.tg029.com/redirect.php?tid=2057&goto=lastpost


看看这个吧 是一个原理

全部回答
  • 1楼网友:纵马山川剑自提
  • 2021-05-02 10:29

using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.Script.Serialization;

public partial class sample3_sample3 : System.Web.UI.Page {

 public class Car  {   private string name;   private int age;

  public string Name   {    get { return this.name; }    set { this.name = value; }   }

  public int Age   {    get { return this.age; }    set { this.age = value; }   }

  public Car ( string name, int age )   {    this.name = name;    this.age = age;   }

 }

    protected void Page_Load(object sender, EventArgs e)     {   JavaScriptSerializer serializer = new JavaScriptSerializer ();   this.Response.Write ( serializer.Serialize ( new Car ( "大众", 10 ) ) );

  SortedList<string, object> values1 = new SortedList<string, object> ();   values1.Add ( "Name", "小明" );   values1.Add ( "Age", 10 );   this.Response.Write ( serializer.Serialize ( values1 ) );

  Hashtable values2 = new Hashtable ();   values2.Add ( "Name", "大明" );   values2.Add ( "Age", 20 );   values2.Add ( "Birthday", new DateTime ( 2000, 1, 1 ) );   this.Response.Write ( serializer.Serialize ( values2 ) );        }

}

  • 2楼网友:洒脱疯子
  • 2021-05-02 10:17

什么意思 不太明白.....net 生成JSON?

我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯