摘要:
//实现json的序列化和反序列化 Person Person = new Person(); Person.Id = 1; Person.Name = "小白"; DataContractJsonSerializer json = new DataContractJsonSerializer(Person.GetType()); string szJson = ""; //序列化 using (MemoryStream stream = new MemoryStream()) { jso... 阅读全文
摘要:
//实现http访问 try { string getpage = @"http://192.168.0.36:8082/News/PlusNews.aspx"; CookieContainer cc = new CookieContainer(); string content = string.Empty; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(getpage); request.Method = "post"; ... 阅读全文