随笔分类 - .net
C#向word中的书签赋值!(包括表格)
摘要:/添加两个引用 using Microsoft.Office.Interop.Word; using System.Data; //红色是需要(根据个人情况设置)的 //l蓝色是调用数据库中查询得来的! //我的书签定义为T1~T5,F1,D1,E00~E67 //鼠标点击事件如下! protect
阅读全文
C# 根据Word 模板生成word 文件
摘要:/// /// 调用模板生成word /// /// 模板文件 /// 生成的具有模板样式的新文件///需插入到文档中的数据 public void ExportWord(string templateFile, string fileName,DataTable dt) { try { Word.Application app = new Word.Application(); //生成word程序对象 //模板文件 string TemplateFile = templateFile; //生成的具有模板样式的新文件 string FileName = fileName; //模板文...
阅读全文
C#字符与ASCII码之间的转换
摘要://字符转换ASCIIpublic static int Asc(string character) { if (character.Length == 1) { System.Text.ASCIIEncoding asciiEncoding = new System.Text.ASCIIEncoding(); int intAsciiCode = (int)asciiEncoding.GetBytes(character)[0]; return (intAsciiCode); } else { throw new Exception("Ch...
阅读全文
浙公网安备 33010602011771号