随笔分类 -  .Net开发

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 阅读(618) 评论(0) 推荐(0)

面对万恶的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 阅读(1278) 评论(0) 推荐(0)

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 阅读(302) 评论(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 阅读(9185) 评论(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 阅读(2353) 评论(1) 推荐(0)

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 阅读(402) 评论(0) 推荐(0)

Ajax的AutoCompleteExtender的使用
摘要:TargetControlID:需要绑定的文本框的IDServicePath:web service的文件路径ServiceMethod:web service的方法·MinimumPrefixLength:输入几个字符开始提示CompletionInterval:输入字符后多长时间进行提示。默认:1秒EnableCaching:是否缓存CompletionSetCount:列表显示多少行,默认10行4.书写web service代码:看看你的文件是否包含下面这几行代码[WebService(Namespace = "http://bittime.dyj")]// 阅读全文

posted @ 2007-07-10 10:31 badyue 阅读(173) 评论(0) 推荐(0)

建一个XMLHttpRequest对象池
摘要:在ajax应用中,通常一个页面要同时发送多个请求,如果只有一个XMLHttpRequest对象,前面的请求还未完成,后面的就会把前面的覆盖掉,如果每次都创建一个新的XMLHttpRequest对象,也会造成浪费。解决的办法就是创建一个XMLHttpRequset的对象池,如果池里有空闲的对象,则使用此对象,否则将创建一个新的对象。下面是我最近写的一个简单的类:/***XMLHttpRequestObjectPool**@authorlegend<legendsky@hotmail.com>*@linkhttp://www.ugia.cn/?p=85*@Copyrightwww.ug 阅读全文

posted @ 2007-04-12 10:18 badyue 阅读(175) 评论(0) 推荐(0)

ASP.NET 2.0 URL映射
摘要:在项目中经常要进行映射首先要解决2个问题第一是支持通配符的映射URL映射是asp.net2.0新增的功能,不支持通配符于是采用了NBEAR的NBear.Web.Modules.UrlRewriteRules进行通配符映射<?xmlversion="1.0"?><!--注意:除了手动编辑此文件以外,您还可以使用Web管理工具来配置应用程序的设置。可以使用VisualStudio中的“网站”->“Asp.Net配置”选项。设置和注释的完整列表在machine.config.comments中,该文件通常位于/Windows/Microsoft.Net/F 阅读全文

posted @ 2007-04-10 14:47 badyue 阅读(360) 评论(0) 推荐(0)

两个简单的分页SQL过程
摘要:create proc Page(@PageIndex int)as declare @page intdeclare @sql varchar(1000)set @page=@PageIndex*5set @sql='select top 5 Brand.BrandID,Brand.BrandName,Brand.HtmlUrl,Brand.TypeID,Brand.LogoUrl2,Brand_Type.BrandTypeNamefrom Brand,Brand_Type where convert(int,substring(Brand.TypeID,2,1))=Brand_Ty 阅读全文

posted @ 2007-02-17 16:52 badyue 阅读(181) 评论(0) 推荐(0)

Aspx 静态化HTML
摘要://生成HTML页 public static bool WriteFile(string strText,string strContent,string strAuthor) { string path = HttpContext.Current.Server.MapPath("/news/"); Encoding code = Encoding.GetEncoding("gb2312"); // 读取模板文件 string temp = HttpContext.Current.Server.MapPath("/news/... 阅读全文

posted @ 2007-02-07 12:53 badyue 阅读(702) 评论(0) 推荐(0)

导航