文章分类 -  C#

摘要:语法格式: public static class StringText { public static string[] WorkSplit(this String str) { return str.Split(new char[] { ' ', '.', '?' }, StringSplitOptions.RemoveEmptyEntries); } public static string[] WorkSplit2(String str) { return str.... 阅读全文
posted @ 2012-07-04 09:39 hejiyong 阅读(107) 评论(0) 推荐(0)
摘要://序列化 string[] arr = {"a", "b", "c"}; System.Xml.Serialization.XmlSerializer ser = new System.Xml.Serialization.XmlSerializer(typeof(string[])); System.IO.MemoryStream mem = new MemoryStream(); System.Xml.XmlTextWriter writer = new System.Xml.XmlTextWrit... 阅读全文
posted @ 2012-06-27 20:21 hejiyong 阅读(113) 评论(0) 推荐(0)
摘要:直接先看效果:实现方法:1. 在Excel中画出布局 ;2. 另存为格式为“.XML”;3. 将里面的内容拷贝出来,通过代码输出,大功告成;代码: Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(DateTime.Now.ToString("yyyyMMddHHmmss") + ".xml", System.Text.Encoding.GetEncoding("gbk" 阅读全文
posted @ 2012-06-27 20:18 hejiyong 阅读(233) 评论(0) 推荐(0)
摘要:1. 添加连接2. 选择存储过程,点击单步调试3. 填入参数值4. 单步执行 阅读全文
posted @ 2012-03-05 13:25 hejiyong 阅读(288) 评论(0) 推荐(0)
摘要:int countStart = System.Environment.TickCount; //计算这行代码运行需要多少秒 DataTable dtUser = dbao.LoginUserAll("", deptID); int countEnd = System.Environment.TickCount - countStart; 通过得到两个时间差,得到运行耗时 阅读全文
posted @ 2012-03-05 00:41 hejiyong 阅读(150) 评论(0) 推荐(0)