随笔分类 - 功能封装
windows文件属性操作 dsofile
摘要:dsofile.dll是com组件,.net程序中引用dsofile.dll文件后,程序集名称会变成“Interop.DSOFile.dll”, com组件需要用regsvr32注册,所以需要注册dsofile.dll程序集,注意不是注册"Interop.DSOFile.dll", Interop.
阅读全文
动态添加行
摘要:动态添加行处理过程:前台将行间和行内的数据用分隔符隔开,然后在后台再用分隔函数提取数据。前台拼接字符串,需要将数据中存在的行间和行内的分隔符编码,后台再解码。 编码说明:"%":"%25" ",":"%2C" "|":"%7C",每条记录之间用"|"分隔,每条记录的值之间用","分隔,值中可能存在"
阅读全文
js 导出到excel
摘要:程序员的基础教程:菜鸟程序员
阅读全文
js 导出到word,excel
摘要:1>js导出,原理:复制页面中的table,让后粘贴到excle中 程序员的基础教程:菜鸟程序员
阅读全文
JS 操作Excel格式
摘要:JS 操作Excel格式 1>操作前注册FSO js操作excel用到了Scripting.FileSystemObject (FSO 文本文件读写),需要开启该功能,否则报错:automation 服务器不能创建对象, 在“运行”中执行regsvr32 scrrun.dll即可开启FSO. 2>设
阅读全文
word、excel、ppt转换成pdf
摘要:word、excel、ppt转换成pdf,调用office的API,原理是调用的office的另存为pdf的命令,将文件保存为pdf格式的文件。 office必须是2007版本,office另存为pdf必须安装一个第三方的插件,excel转换成pdf要开启打印服务,下载地址SaveAsPDFandX
阅读全文
word、excel、ppt转换成html
摘要:将word、excel、ppt转换成html,调用office的API;转换后的html样式会丢失 注意:请设置web.config的system.web加点中添加一下配置,操作excel或word需要管理员的权限,否则报错“否则会提示检索 COM 类工厂中 CLSID 为 {000209FF-00
阅读全文
使用NPOI实现excel的导入导出
摘要:NPOI2可以对excle2003和excle2007进行导入导出的操作 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Web; 5 6 using System.IO;
阅读全文
文件下载的四种方式
摘要:1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Web; 5 6 using System.IO; 7 8 /// 9 /// 文件下载有以下四种方式, 大文件下载的处理方法:将文件分块下载。 10 /// Response.OutputStream.Write 11 /// Response.TransmitFile 12 /// Response.WriteFile 13 /// Response.BinaryWrite 14 /// ...
阅读全文
文件上传通用类
摘要:1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Web; 5 6 using System.IO; 7 using System.Web.UI.WebControls; 8 9 public class FileUploadHelper10 {11 private HttpPostedFile postedFile;12 13 public FileUploadHelper(HttpPostedFile postedFile)14 {15...
阅读全文
将html导入到excel或word
摘要:1>通过js实现,在页面的前台调用微软office的com组件,要求用户必须安装office,启动automation服务,并且在浏览器中启用未注册的activex选项.function importToExcel(tableid) { var curTbl = document.getElementById(tableid); try { var oXL = new ActiveXObject("Excel.Application"); } catch (e) { alert("请安装微软Excel并且在浏览器的安全级别中启用‘对未标记为安...
阅读全文