2010年5月10日
摘要: /// <summary> /// 生成缩略图 /// </summary> /// <param name="sourceImagePath">原图片路径(绝对路径)</param> /// <param name="thumbnailImageWidth">缩略图的宽度(高度与按源图片比例自动生成)</param> pub... 阅读全文
posted @ 2010-05-10 09:36 BoneKing 阅读(204) 评论(0) 推荐(0) 编辑
摘要: RegistryKey rkey = Registry.LocalMachine; //The second parameter tells it to open the key as writable RegistryKey rkey1 = rkey.OpenSubKey("Software",true); RegistryKey rkey2 = rkey1.... 阅读全文
posted @ 2010-05-10 09:35 BoneKing 阅读(153) 评论(0) 推荐(0) 编辑
  2010年5月7日
摘要: 这段时间因项目需要,要实现WinForm下的文件上传,个人觉得采用FTP方法太麻烦,还得配置FTP服务器,要通过防火墙也是一个麻烦。本来打算采用WebClient方法,但是采用这个方法实现后,进度条很短时间后就达到最大值,要等待一段时间才能传送完毕,要是文件太大(我这里测试约100M),会出现错误。后来才知道,原来WebClient是在加载完整个文件到内存后才真正开始上传,怪不得会出现前面的问题了... 阅读全文
posted @ 2010-05-07 14:13 BoneKing 阅读(591) 评论(0) 推荐(0) 编辑
  2010年5月6日
摘要: /// <summary> /// Converts an image into an icon. /// </summary> /// <param name="img">The image that shall become an icon</param> /// <param name="size">The width and he... 阅读全文
posted @ 2010-05-06 10:35 BoneKing 阅读(1542) 评论(0) 推荐(0) 编辑
  2010年3月29日
摘要: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Runtime.InteropServices;using... 阅读全文
posted @ 2010-03-29 17:25 BoneKing 阅读(1061) 评论(0) 推荐(0) 编辑
  2010年2月21日
摘要: System.Diagnostics.ProcessStartInfo Info = new System.Diagnostics.ProcessStartInfo(); //设置外部程序名 Info.FileName = "Update.exe"; Info.WorkingDirectory = Application.StartupPath; //声明一个程序类 System.Diagnost... 阅读全文
posted @ 2010-02-21 16:47 BoneKing 阅读(183) 评论(0) 推荐(0) 编辑
摘要: VB.net 如果需要单实例运行,只要在其属性中选中一个复选框就OK了,简单得不能再简单了。。。在 C# 中,天生不支持单实例运行,如果想要单实例,处理起来很复制。简单点的有 查找进程信息、线程同步等。用起来很不爽。在 VS2008 的 MSDN 中,搜索 “单实例”,找到了MS官方的实现方法。页面地址:单实例检测示例ms-help://MS.VSCC.v90/MS.MSD... 阅读全文
posted @ 2010-02-21 16:42 BoneKing 阅读(664) 评论(0) 推荐(0) 编辑
  2009年5月10日
摘要: image to byte[] MemoryStream ms=new MemoryStream();byte[] imagedata=null;pictureBox1.Image.Save(ms,System.Drawing.Imaging.ImageFormat.Gif );imagedata=ms.GetBuffer ();byte[] to image ms = New IO.Memory... 阅读全文
posted @ 2009-05-10 17:42 BoneKing 阅读(5880) 评论(0) 推荐(1) 编辑
  2009年4月22日
摘要: /// /// 将文字转换成图片 /// /// /// private System.Drawing.Bitmap CreateCheckCodeImage(string checkCode) { if (checkCode == null || che... 阅读全文
posted @ 2009-04-22 11:39 BoneKing 阅读(1990) 评论(1) 推荐(0) 编辑
  2009年2月26日
摘要: public abstract class BaseClass { //改变事件 public delegate void ItemChangedEventHandler(object sender, stringItemStr); public abstract eventItemChangedEventHandlerIte... 阅读全文
posted @ 2009-02-26 17:30 BoneKing 阅读(571) 评论(0) 推荐(0) 编辑