摘要: 1 public string FilterSpecial(string str)//特殊字符过滤函数 2 { 3 if (str==null||str == "") //如果字符串为空,直接返回 4 { 5 return str; 6 } 7 else 8 { 9 str = str.Replace("'", "");10 str = str.Replace("<", "");11 str = str.... 阅读全文
posted @ 2013-02-28 09:31 小笔头大做用 阅读(272) 评论(0) 推荐(0) 编辑
摘要: 1 protected void CreateExcel(DataTable dt, string fileName) 2 { 3 System.Text.StringBuilder strb = new System.Text.StringBuilder(); 4 strb.Append(" <html xmlns:o=\"urn:schemas-microsoft-com:office:office\""); 5 strb.Append("xmlns:x=\"urn:schemas-microsoft-com:office: 阅读全文
posted @ 2013-02-28 09:28 小笔头大做用 阅读(358) 评论(0) 推荐(0) 编辑
摘要: 1.首先上传Excel 文件,和普通上传方法一样.2.导入Excel 里面的数据: 1 private bool ImportExcel() 2 { 3 bool bResult = true; 4 string filepath = ""; 5 string path = HttpContext.Current.Request.MapPath("~/UploadFiles/"); 6 try 7 { 8 DirectoryInfo di = new DirectoryInfo(p... 阅读全文
posted @ 2013-02-28 09:21 小笔头大做用 阅读(546) 评论(0) 推荐(0) 编辑