随笔分类 -  .NET

摘要:有两个窗体(frmMain,frmChild) frmMain中有一LISTVIEW控件,在双击LISTVIEW后弹出frmChild. 在frmChild修改数据后关闭frmChild frmMain中LISTVIEW的数据也同时更新.先把frmMain中LISTVIEW的属性中的Modifiers改为public 父窗体: frmChild f = new frmChild(); f.Owne... 阅读全文
posted @ 2010-10-28 10:29 韩天伟 阅读(1128) 评论(0) 推荐(0) 编辑
摘要:csc /target:library /out:d:\Pager.dll d:\Pager.cs 阅读全文
posted @ 2010-10-09 14:09 韩天伟 阅读(489) 评论(2) 推荐(0) 编辑
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--staticintxValue(refintnum,refintnum2){num=2*num;num2=2*num2;returnnum;}staticvoidMain(string[]args){... 阅读全文
posted @ 2010-10-08 12:15 韩天伟 阅读(3233) 评论(0) 推荐(0) 编辑
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--usingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingSystem.IO;usingSystem.Collections;... 阅读全文
posted @ 2010-09-29 16:35 韩天伟 阅读(1691) 评论(0) 推荐(1) 编辑
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--usingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingSystem.DirectoryServices;usingSyst... 阅读全文
posted @ 2010-09-29 16:34 韩天伟 阅读(2023) 评论(2) 推荐(0) 编辑
摘要://添加应用程序池空间引用using System.DirectoryServices;代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--stringmethod="Start";//Start开启Recycle回收Stop停止stringAppPo... 阅读全文
posted @ 2010-09-27 14:30 韩天伟 阅读(3835) 评论(0) 推荐(0) 编辑
摘要:Global.asax需要添加的代码。利用我们了解当前页面的运行效率。 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--protectedvoidApplication_BeginRequest(Objectsender,EventArgse){A... 阅读全文
posted @ 2010-09-27 10:28 韩天伟 阅读(1378) 评论(0) 推荐(0) 编辑
摘要:日期转化一为了达到不同的显示效果有时,我们需要对时间进行转化,默认格式为:2007-01-0314:33:34,要转化为其他格式,要用到DateTime.ToString的方法(String,IFormatProvider),如下所示:usingSystem;usingSystem.Globalization;Stringformat="D";DateTimedate=DataTime,Now;R... 阅读全文
posted @ 2010-09-23 01:11 韩天伟 阅读(226291) 评论(1) 推荐(11) 编辑
摘要:c#读写xml文件已知有一个XML文件(bookstore.xml)如下:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--<?xmlversion="1.0"encoding="gb2312"?><bookstore><... 阅读全文
posted @ 2010-09-14 23:44 韩天伟 阅读(836) 评论(0) 推荐(0) 编辑
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--///<summary>///判断一个字符串是否为合法整数(不限制长度)///</summary>///<paramname="s">字符串</param&g... 阅读全文
posted @ 2010-09-02 16:38 韩天伟 阅读(16953) 评论(0) 推荐(0) 编辑
摘要:前几天做页面,排好的html页面复制到aspx页面上就是会出现差异,比如字体定义无效,基本的表现就是怎么改样式都没显示或只有某些浏览器正常,搞了半天才发现是编码问题,DW默认新建的文件编码是gb2312的,vs默认是utf-8的,时间原因也没重新排,就在web.config的Configuration节点下对这个页面单独设置了编码。代码Code highlighting produced by A... 阅读全文
posted @ 2010-08-27 10:16 韩天伟 阅读(770) 评论(0) 推荐(0) 编辑
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--//实现黄底黑字的提示效果用ToolTip控件:privatevoidlistView1_MouseMove(objectsender,MouseEventArgse){ListViewItemite... 阅读全文
posted @ 2010-08-23 13:38 韩天伟 阅读(2461) 评论(0) 推荐(0) 编辑
摘要:先介绍一下比较简单的使用方法:给COOKIES赋值Response.Cookies["uid"].Value = "20";Response.Cookies["LoginCode"].Value = "58469";以上就是分别对两个COOKIES变量赋了两个不同的传,那么在使用COOKIES时,我们怎样来控制COOKIES的有效期呢,看下面:Response.Cookies["uid"].Exp... 阅读全文
posted @ 2010-08-15 20:09 韩天伟 阅读(8383) 评论(1) 推荐(1) 编辑
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--privateListViewlistView1;privatevoidInitializeListView1(){listView1=newListView();//Settheviewtodeta... 阅读全文
posted @ 2010-07-23 16:40 韩天伟 阅读(1743) 评论(0) 推荐(0) 编辑
摘要:URL重写也就是让动态页面伪装成“静态页面”,一方面可以隐藏真实的页面文件地址,另一方面对被搜索引擎的也有好处。(在不支持URLWRITE.NET组件的空间里面这是最好的方法) 在ASP.NET中,使用Global.asax可以轻易的实现这个目的,原理简单,具体的代码一看便知:代码Code highlighting produced by Actipro CodeHighl... 阅读全文
posted @ 2010-06-22 13:37 韩天伟 阅读(1204) 评论(1) 推荐(0) 编辑
摘要:远程序桌面登录的.NET开发,可以使用MSTSCLib.dll和MsTscAxWrapper.dll两个转换过的动态库,而无需使用WINDOWS自带的OCX,因为使用OCX开发可以会遇到其它问题。 主要代码:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.co... 阅读全文
posted @ 2010-06-18 01:26 韩天伟 阅读(7561) 评论(2) 推荐(0) 编辑
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--#region拦截Windows消息protectedoverridevoidWndProc(refMessagem){constintWM_SYSCOMMAND=0x0112;constintSC_... 阅读全文
posted @ 2010-04-30 09:23 韩天伟 阅读(2166) 评论(2) 推荐(0) 编辑
摘要:代码 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--//须添加对System.Web的引用usingSystem.Web.Security;///<summary>///SHA1加密字符串///</summary>///<... 阅读全文
posted @ 2010-04-29 12:43 韩天伟 阅读(12758) 评论(0) 推荐(3) 编辑
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--//1:publicstaticboolIsExist(stringuri){HttpWebRequestreq=null;HttpWebResponseres=null;try{req=(HttpW... 阅读全文
posted @ 2010-04-21 23:20 韩天伟 阅读(2144) 评论(0) 推荐(0) 编辑
摘要:拖动无边框窗体Form至桌面任何位置 首先建一个Windows应用程序将Form1的 FormBorderStyle属性设置为Noe创建控件panel1放在标题栏位置代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--PointmouseOff;//鼠... 阅读全文
posted @ 2010-04-20 09:38 韩天伟 阅读(1188) 评论(0) 推荐(0) 编辑