随笔 - 441  文章 - 4  评论 - 84  阅读 - 109万 

随笔分类 -  .net水笔

.net心得
window mobile 防止系统休眠代码
摘要:window mobile 过一段时间就会自动休眠,下面的代码可以禁止机器自动休眠。代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--[DllImport("CoreDll.dll")]privatestaticexternvoidSystemIdleTimerReset();privatestaticintnDisableSleepCalls=0;privatestaticSystem.Threading.TimerpreventSleepTi 阅读全文
posted @ 2010-12-14 16:15 自由港 阅读(274) 评论(0) 推荐(0) 编辑
C#扩展方法(转贴)
摘要:那么扩展方法起什么作用呢?很多时候我们想为已经存在的类扩展某些功能,而又没有必要去继承该类,甚至有时候这个类根本就不允许继承,如String类,这时候就可以使用扩展方法来为其扩展功能。 下面举例说明: 一、我们创建一个类库如下:Code:usingSystem; usingSystem.Collections.Generic; usingSystem.Linq; usingSystem.Text... 阅读全文
posted @ 2010-11-26 14:18 自由港 阅读(261) 评论(0) 推荐(0) 编辑
word 另存为xml后,读取xml的图片数据
摘要:我们把word文档另存为xml后。图片数据是使用base64编码存储的,这样我们就可以使用base64对数据进行解码。把图片读取出来。代码如下:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--privatevoidbutton1_Click(obj... 阅读全文
posted @ 2010-08-24 09:16 自由港 编辑
sliverlight 跨域访问方法
摘要:方法1.在被访问的服务器根目录放上crossdomain.xml的文件。文件内容如下:[代码]方法2.在被访问服务器的根目录放置一个clientaccesspolicy.xml的文件。文件内容如下:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--&... 阅读全文
posted @ 2010-07-08 15:09 自由港 阅读(197) 评论(0) 推荐(0) 编辑
将ibatis.net 配置文件编译到dll中
摘要:在使用ibatis编写程序的时候我们希望将配置文件隐藏起来,比如数据库的配置信息等。ibatis。net提供了嵌入资源的方式,可以将配置文件编译到程序集当中,达到保护程序的目的。现在我们以嵌入数据库配置为例:1.编写sqlmap.config代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.Co... 阅读全文
posted @ 2010-06-25 08:07 自由港 阅读(507) 评论(0) 推荐(0) 编辑
c# 事件示例
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Drawing;using System.Data;using System.Text;using System.Windows.Forms;using System.IO;/// <summary>/// 自定义... 阅读全文
posted @ 2010-06-24 21:27 自由港 阅读(155) 评论(0) 推荐(0) 编辑
动态修改大小的Panel用户控件
摘要:定义一个透明的可以使用鼠标拖动,改变大小的透明Panel用户控件,可以显示黑色边框。[代码] 阅读全文
posted @ 2009-08-09 23:27 自由港 阅读(657) 评论(0) 推荐(0) 编辑
quartz.net 远程任务配置
摘要:quartz.net 是一个非常好的任务运行开源框架.我在做windform程序的时候,准备集成quartz.net 任务框架执行任务.结果发现集成到一起的时候结果有冲突.问题描述:如果直接启动winform程序的时候,这个时候调用quartz.net 的时候没有问题,如果使用对话框窗体的时候,quartz就会报错,估计是ui的线程与quartz线程冲突的缘故.这个时候我想可以使用远程任务来处理这... 阅读全文
posted @ 2008-11-29 21:43 自由港 阅读(3825) 评论(1) 推荐(0) 编辑
SSIS 脚本任务读取文件
摘要:变量fileName输入参数,读取文件内容放到变量content中。 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1 Public Sub Main() 2 ' 3 ' Add your code here... 阅读全文
posted @ 2008-10-18 10:18 自由港 阅读(1003) 评论(0) 推荐(0) 编辑
自定义长时间定时器对象
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->public class TimerObject { private Timer timer; public TimerObject() ... 阅读全文
posted @ 2008-10-10 15:11 自由港 阅读(190) 评论(0) 推荐(0) 编辑
winform 编程代码片段
摘要:1.在datagrid上点击时高亮显示整行。 Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->private void dataGrid1_MouseUp(object sender, System.Windows.Forms.Mouse... 阅读全文
posted @ 2008-08-22 15:12 自由港 阅读(205) 评论(0) 推荐(0) 编辑
单点登陆原理
摘要:最近有一个任务,需要使用。net实现单点登陆,到网上找了半天,没有看到相关的资料。 。net2.0 有一个实现,在web.config 配置,可以实现单点登陆,但是只能基于一个域名。 如 a.abc.com,b.abc.com。 怎么实现呢,我们知道cookie不能够跨域,session当然也是不能跨域,那么web怎么才能做到单点登陆呢。 我的解决方案如下: 一个认证中心,A应用,B应用。 1... 阅读全文
posted @ 2008-04-27 23:11 自由港 阅读(795) 评论(2) 推荐(1) 编辑
复写page的Render方法
摘要:public class SetToken :System.Web.UI.Page { protected override void Render(System.Web.UI.HtmlTextWriter writer) { StringWriter sw = new StringWriter(); ... 阅读全文
posted @ 2008-04-02 14:36 自由港 阅读(522) 评论(0) 推荐(0) 编辑
IHttpHandler使用session
摘要:在开发过程中发现实现了IHttpHandler后,使用session发现出错, 出错原因 context.Session 为null,后来得知,实现IHttpHandler接口后,还是不能用Session的, 必须再继承IRequiresSessionState接口,该接口无任何方法和属性, 只要继承就可以运用Session了,该接口在using System.Web.SessionState命... 阅读全文
posted @ 2008-03-31 16:27 自由港 阅读(823) 评论(0) 推荐(0) 编辑
.net2.0线程使用参数
摘要:using System; using System.Threading; namespace ParameterizedThreadStartTest { class Program { static void Main(string[] args) { ParameterizedThreadStart myParamet... 阅读全文
posted @ 2007-08-22 17:37 自由港 阅读(218) 评论(0) 推荐(0) 编辑
用户控件使用事件
摘要:用户控件使用事件与调用页面交互 帐户 自由港1 类别 [选择一个类别或键入一个新类别] ; [选择一个类别或键入一个新类别] ; [选择一个类别或键入一个新类别] 1.定义事件参数类 using System; namespace ASPNetCookbook.CSExamples { /// /// This class provides the definition of the cust... 阅读全文
posted @ 2007-07-29 16:07 自由港 阅读(300) 评论(0) 推荐(0) 编辑
asp.net 2.0 使用sqlserver2005 新的通知数据缓存实现
摘要:asp.net 2.0 使用sqlserver2005 新的通知数据缓存实现 阅读全文
posted @ 2006-09-20 00:37 自由港 阅读(1392) 评论(9) 推荐(0) 编辑
使用脚本调用webservice中文乱码的解决!
摘要:js调用webservice乱码问题解决办法 阅读全文
posted @ 2006-09-17 23:17 自由港 阅读(1831) 评论(0) 推荐(0) 编辑
asp2.0 webservice 开发与发布新特性
摘要:asp.net2.0 webservice 开发与发布新特性 阅读全文
posted @ 2006-09-16 11:45 自由港 阅读(645) 评论(1) 推荐(0) 编辑
vs2005 global.asax 编译后的bug?
摘要:vs2005 global.asax文件的bug,事件不能正常启动! 阅读全文
posted @ 2006-09-07 21:36 自由港 阅读(1792) 评论(3) 推荐(0) 编辑

点击右上角即可分享
微信分享提示