2011年10月13日

C#导出EXCEL的几种方法

摘要: using System; using System.Collections.Generic; using System.Text; using System.Data; using System.Windows.Forms; using System.Reflection; namespace DMS { /// <summary> /// C#操作Excel类 /// </summary> class ExcelOperate { //法一 //public bool DataSetToExcel(DataSet dataSet, bool isShowExcle) 阅读全文

posted @ 2011-10-13 01:53 badyue 阅读(32282) 评论(2) 推荐(3) 编辑

C# DataSet和Excel之间导入导出

摘要: publicclassImportExportToExcel2{3privatestringstrConn;45privateSystem.Windows.Forms.OpenFileDialogopenFileDlg=newSystem.Windows.Forms.OpenFileDialog();6privateSystem.Windows.Forms.SaveFileDialogsaveFileDlg=newSystem.Windows.Forms.SaveFileDialog();78publicImportExportToExcel()9{10//11//TODO:在此处添加构造函数 阅读全文

posted @ 2011-10-13 01:51 badyue 阅读(598) 评论(0) 推荐(0) 编辑

2011年10月9日

面对万恶的IE 对TBODY 只读,而且不能设置INNERHTML的解决办法

摘要: 在FF下 document.getElementById("tbody1").innerHTML="";是正常但在IE下就不行了 我们这样办 function $MC$(ID) { return document.getElementById(ID); } /*获取父节点*/ /*$p($("id"),"DIV")*/ function $MCp(id, t) { for (var i = 0, n = id; n = n.parentNode; i++) { if (n.tagName == t) { retur 阅读全文

posted @ 2011-10-09 23:14 badyue 阅读(1253) 评论(0) 推荐(0) 编辑

2010年10月19日

C#操作Word完全功略

摘要: 前提:导入COM库:Microsoft word 11.0 Object Library.引用里面就增加了:创建新WordobjectoMissing=System.Reflection.Missing.Value;Word._ApplicationoWord;Word._DocumentoDoc;oWord=newWord.Application();oWord.Visible=true;oDoc=oWord.Documents.Add(refoMissing,refoMissing,refoMissing,refoMissing);打开文档:objectoMissing=System.Re 阅读全文

posted @ 2010-10-19 05:19 badyue 阅读(295) 评论(0) 推荐(0) 编辑

C#利用word书签实现模板打印功能

摘要: C#中的水晶报表好用,但是需要注册码。这里介绍C#调用word直接打印,既方便,又漂亮。开发指南:1. 必须安装office的.net开发包。2. 在工程的reference中添加com组件:Microsoft Word 11.0 Object Library打印的代码如下:Microsoft.Office.Interop.Word.Application app = null; Microsoft.Office.Interop.Word.Document doc = null; object missing = System.Reflection.Missing.Value; object 阅读全文

posted @ 2010-10-19 05:18 badyue 阅读(873) 评论(0) 推荐(0) 编辑

C#用 excel 作为模板打印的源码

摘要: //打印操作,套打、打印、预览enum PrintFlag{/// <summary>/// 套打,只打印没有印刷的部分/// </summary>CasePrint,/// <summary>/// 打印全部/// </summary>PrintAll,/// <summary>/// 预览全部/// </summary>PreviewAll}//套打、打印、预览三个按钮关联些委托实例private void Print_Click(object sender, System.EventArgs e){Button bt 阅读全文

posted @ 2010-10-19 05:17 badyue 阅读(9036) 评论(0) 推荐(0) 编辑

C#调用QQ的DLL实现截图功能

摘要: 今天写个程序 需要抓屏 懒得写代码 上网找 突然想到QQ的抓屏不错 直接拿来用就是了 [ DllImport( "CameraDll.dll", EntryPoint="CameraSubArea", CharSet=CharSet.Ansi )]private static extern bool CameraSubArea(); if(CameraSubArea()){IDataObject iData = System.Windows.Forms.Clipboard.GetDataObject();if(iData.GetDataPresent(& 阅读全文

posted @ 2010-10-19 05:16 badyue 阅读(2281) 评论(1) 推荐(0) 编辑

解决关于System.Collections.IList在WebService中无法序列化的问题

摘要: 1.在WebService的类中添加特殊属性 [XmlInclude(typeof(List))] 红色字为ILIST中数据类型 2.为ILIST集合中的类添加特殊属性 [Serializable] public class cst_ProjectGroupStatusInfo { } 3.类里面必需有一个无参数的构造函数 public cst_ProjectGroupStatusInfo() { //这里的内容可以为空 } 经过以上3步解决返回值为System.Collections.IList类型的问题 阅读全文

posted @ 2010-10-19 05:14 badyue 阅读(2056) 评论(1) 推荐(0) 编辑

2010年2月24日

Ajax 手写JS

摘要: var httpRequest = false;var mesdivs = nullfunction sendRequest(url, mesdiv) { mesdivs = mesdiv; httpRequest = false; if (window.XMLHttpRequest) { httpRequest = new XMLHttpRequest(); if (httpRequest.overrideMimeType) { } } else if (window.ActiveXObject) { try { httpRequest = new ActiveXObject("M 阅读全文

posted @ 2010-02-24 10:01 badyue 阅读(1543) 评论(0) 推荐(0) 编辑

2009年4月24日

webservice调用方法

摘要: 一、WebService在cs后台程序中的调用 A、通过命名空间和类名直接调用 示例: WebService ws = new WebService(); string s = ws.HelloWorld(); B、通过添加WEB引用的方式调用,首先添加WEB引用,通过URL指向WEBSERVICE, 指定WEB引用名,假设为KK; 示例: kk.WebService n = new kk.WebService(); string ss=n.HelloWorld(); 二、WebService在前台页面的JS调用方法 1、首先通过下面的方法把Webservice在前台引用进来 <asp: 阅读全文

posted @ 2009-04-24 15:58 badyue 阅读(385) 评论(0) 推荐(0) 编辑

导航