IT
摘要: (一)写入:Stream ms;byte []picbyte; openFileDialog1.Filter = SystemConst.IMAGE_FILE_FILTER;if (this.openFileDialog1.ShowDialog() == DialogResult.OK) {if ((ms = openFileDialog1.OpenFile()) != n... 阅读全文
posted @ 2010-06-28 12:34 liufei 阅读(817) 评论(0) 推荐(0) 编辑
摘要: private void CopyFile(string fromFile, string toFile, int lengthEachTime) { FileStream fileToCopy = new FileStream(fromFile, FileMode.Open, FileAccess.Read); FileStream copyToFile = new FileStream(toF... 阅读全文
posted @ 2010-06-28 12:33 liufei 阅读(358) 评论(0) 推荐(0) 编辑
摘要: usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.We... 阅读全文
posted @ 2010-06-28 12:28 liufei 阅读(194) 评论(0) 推荐(0) 编辑
摘要: C#中控制IIS服务停止ServiceController sc = new ServiceController("iisadmin");if(sc.Status=ServiceControllerStatus.Running) sc.Stop(); 启动IIS服务ServiceController sc = new ServiceController("iisadmin"); sc.Start(... 阅读全文
posted @ 2010-06-28 12:26 liufei 阅读(584) 评论(0) 推荐(0) 编辑
摘要: 来源:互联网winform程序相对web程序而言,功能更强大编程更方便,但软件更新却相当麻烦,要到客户端一台一台地升级,面对这个实际问题,在最近的一个小项目中,本人设计了一个通过软件实现自动升级技术方案,弥补了这一缺陷,有较好的参考价值。一、升级的好处 长期以来,广大程序员为到底是使用Client/Server,还是使用Browser/Server结构争论不休,在这些争论当中,C/S结构的程序的可... 阅读全文
posted @ 2010-06-28 12:25 liufei 阅读(328) 评论(0) 推荐(0) 编辑
摘要: 来自:http://www.cnblogs.com/leafyoung/archive/2005/10/10/251436.html对于数据库应用而言, 一个合适的序列号生成器是非常有用的, 用它我们可以方便地给新增的记录的id字段(主键)赋值, 当然我们同样可以用Identity类型主键, 但是假如同时存在父子关系的记录, 那么给子记录赋parent_id就极为不便, 我们必须先将父记录插入到数... 阅读全文
posted @ 2010-06-28 12:22 liufei 阅读(1137) 评论(0) 推荐(1) 编辑
摘要: ///<summary>///下载文件///</summary>///<paramname="URL">下载文件地址</param>///<paramname="Filename">下载后的存放地址</param>///<paramname="Prog">用于显示的进度条</param>publicvo... 阅读全文
posted @ 2010-06-28 12:21 liufei 阅读(362) 评论(0) 推荐(0) 编辑
摘要: asp.net2.0以后,我们有了很多种文件下载的选择。[代码]以上除了第四种不推荐以外,其他的都可以,但是个人感觉分块下载的要好一点。没有仔细测试,所以可能有问题。注意:对于中文文件名要编码才能正确显示。对于长中文文件名(UTF8编码后大于153字节的中文)即使编码了,还是有问题的,大家可以参考这个链接。 http://hi.baidu.com/river_5566/blog/item/d668... 阅读全文
posted @ 2010-06-28 12:19 liufei 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 最近要做一个项目涉及到C#中压缩与解压缩的问题的解决方法,大家分享。这里主要解决文件夹包含文件夹的解压缩问题。1)下载SharpZipLib.dll,在http://www.icsharpcode.net/OpenSource/SharpZipLib/Download.aspx中有最新免费版本,“Assembliesfor.NET1.1,.NET2.0,.NETCF1.0,.NETCF... 阅读全文
posted @ 2010-06-28 12:18 liufei 阅读(364) 评论(0) 推荐(0) 编辑
摘要: 注:本程序是在VS2005基础上写的。1。如果不想让程序在任务栏中显示,请把窗体的属性ShowInTaskbar设置为false;2。如果想让程序启动时就最小化,请设置窗体的属性WindowState设置为Minimized。(Minimized 最小化,Normal正常启动,Maximized最大化)3。拉一个NotifyIcon控件notifyIcon,为控件notifyIcon的属性Icon... 阅读全文
posted @ 2010-06-28 12:18 liufei 阅读(542) 评论(1) 推荐(0) 编辑
摘要: using System;using System.IO;using System.IO.Compression;using System.Collections;using System.Collections.Generic;using System.Text;///调用方法///来自:http://www.cnblogs.com/andyhuang/archive/2009/02/05/13... 阅读全文
posted @ 2010-06-28 12:17 liufei 阅读(1617) 评论(0) 推荐(0) 编辑
摘要: private void InitTree(TreeNodeCollection Nds, string parentId) { TreeNode tmpNd; IList<ProClass> rows = ProClassService.SelectParent(int.Parse(parentId)); foreach (ProClass row in rows) { tmpNd ... 阅读全文
posted @ 2010-06-28 12:16 liufei 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 1. 如何创建一个可改变大小没有标题栏的窗体?(How to create a form with resizing borders and no title bar?) form1.Text = string. Empty; form1.ControlBox = false; 2. 如何在.NET的Windows窗体上启用XP主题集?(How to use XP Themes with Wind... 阅读全文
posted @ 2010-06-28 12:15 liufei 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 打开QQ的时候,QQ新闻弹出窗体在屏幕的右下角就会慢慢升起一个小窗口,占用的地方不大,可以起到提示的作用。下面就让我们来看看,怎样用系统API来轻松实现这个功能。API原型函数:boolAnimateWindow(IntPtrhwnd,intdwTime,intdwFlags);从字面的意思来看,这个函数名为"活动的窗口",事实上也如此,通过这个函数,可以使我们的窗体动作丰富起来,要在c#中使用w... 阅读全文
posted @ 2010-06-28 12:14 liufei 阅读(790) 评论(0) 推荐(1) 编辑
摘要: private void CopyFile(string fromFile, string toFile, int lengthEachTime) { FileStream fileToCopy = new FileStream(fromFile, FileMode.Open, FileAccess.Read); FileStream copyToFile = new FileStream(toF... 阅读全文
posted @ 2010-06-28 12:12 liufei 阅读(155) 评论(0) 推荐(0) 编辑