C++技巧:JS中對象轉(zhuǎn)到c#對象方法

字號:


    c#
    protected void Page_Load(object sender, EventArgs e)
    {
    byte[] b = new byte[this.Request.InputStream.Length];
    this.Request.InputStream.Read(b, 0, b.Length);
    string s = System.Text.Encoding.Default.GetString(b);
    student s1 = (student)JavaScriptConvert.DeserializeObject(s, typeof(student));
    }
    public class student
    {
    public string Name
    {
    get{;}
    set{;}
    }
    public string Class
    {
    get{;}
    set{;}
    }
    };
    所需要組件下載http://james.newtonking.com