07 2011 档案
摘要:说明:将指定文件路径对应的所有文件和文件夹以及子文件夹保存到数据库点击页面的button按钮触发事件 string path=//z这里在界面获取用户输入绝对路径 int start = path.LastIndexOf(@"\") + 1; string root = path.Substring(start);// 根目录 FolderMange.InsertFolder(1, root, "文件夹", " ");//存入数据库,我自己定义一个方法 ShowFiles(path, root);//递归 数据库字段id 、pid(所
阅读全文
摘要:///获取文件后缀名 /// <summary> /// 获取文件后缀名 /// </summary> /// <param name="s">传入字符串</param> /// <returns>返回文件后缀名</returns> public string SuffixName(string s) { if(s.LastIndexOf('.')==-1) { return null; } return s.Substring(s.LastIndexOf('.') +
阅读全文
摘要:源代码完全公开,欢迎大家灌水!部分代码如下1. //Response.ContentType是输出流的 HTTP MIME 类型 //Response.ContentType --- word文件 //application/vnd.ms-excel --- excel文件 //更多格式请参考http://walleyekneel.iteye.com/blog/979524 HttpContext.Current.Response.Charset = "utf-8"; HttpContext.Current.Response.ContentEncoding = System
阅读全文