//获取http通过post传来的json数据
var request = System.Web.HttpContext.Current.Request;
byte[] requestData = new byte[request.InputStream.Length];
request.InputStream.Read(requestData,0,(int)request.InputStream.Length);
string json = Encoding.UTF8.GetString(requestData);
//Jsonstr函数读取json数据的文本txt
//string json = ClassLibrary01.User01.Jsonstr("D:\\Json.txt");
//实例化一个能够序列化数据的类
JavaScriptSerializer js = new JavaScriptSerializer();
//将json数据转化为对象类型并赋值给user
ClassLibrary01.User01.User user = js.Deserialize<ClassLibrary01.User01.User>(json);