2012年10月18日

c#选择文件并读取EXECL

摘要: //选取try { string strexcelPath; openFileDialog1.Filter = "Excel2003 *xls|*xls|Excel2007 *xlsx|*xlsx"; openFileDialog1.FileName = ""; //1、读取数据 openFileDialog1.Multiselect = false; if (openFileDialog1.S... 阅读全文

posted @ 2012-10-18 15:56 习惯简单 阅读(1087) 评论(0) 推荐(0) 编辑

JSON转XML

摘要: public static XmlDocument Json2Xml(string sJson) { //XmlDictionaryReader reader = JsonReaderWriterFactory.CreateJsonReader(Encoding.UTF8.GetBytes(sJson), XmlDictionaryReaderQuotas.Max); //XmlDocument doc = new XmlDocument(); //doc.Load(reader); Java... 阅读全文

posted @ 2012-10-18 15:01 习惯简单 阅读(470) 评论(0) 推荐(0) 编辑

HTTP请求

摘要: public static string DoPost(string url, IDictionary<string, string> parameters) { HttpWebRequest req = GetWebRequest(url, "POST"); req.ContentType = "application/x-www-form-urlencoded;charset=utf-8"; byte[] postData = Encoding.UTF8.GetBytes(BuildQuery(paramete... 阅读全文

posted @ 2012-10-18 15:00 习惯简单 阅读(181) 评论(0) 推荐(0) 编辑

键值对排序并MD5加密

摘要: public static class CreateSign { public static string SignTopRequest(IDictionary<string, string> parameters, string secret) { return SignTopRequest(parameters, secret, true); } public static string SignTopRequest(IDictionary<string, string> parameters, strin... 阅读全文

posted @ 2012-10-18 14:59 习惯简单 阅读(1109) 评论(0) 推荐(0) 编辑

导航