09 2013 档案

摘要:public class ChangeImage { /// /// 将Image转换为byte[] /// /// Image /// byte[] public static byte[] ConvertImage(Image image) { MemoryStream ms = new MemoryStream(); image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); ... 阅读全文
posted @ 2013-09-26 11:23 北美上映 阅读(240) 评论(0) 推荐(0) 编辑
摘要:编写程序的时候,经常需要用的项目根目录。自己总结如下 1、取得控制台应用程序的根目录方法 方法1、Environment.CurrentDirectory 取得或设置当前工作目录的完整限定路径 方法2、AppDomain.CurrentDomain.BaseDirectory 获取基目录,它由程序集冲突解决程序用来探测程序集 2、取得Web应用程序的根目录方法 方法1、HttpRuntime.AppDomainAppPath.ToString();//获取承载在当前应用程序域中的应用程序的应用程序目录的物理驱动器路径。用于App_Data中获取 方法2、Server.MapPath(" 阅读全文
posted @ 2013-09-24 17:39 北美上映 阅读(156) 评论(0) 推荐(0) 编辑
摘要:这是个封装好的类,非常好用using System;using System.Runtime.InteropServices;namespace SystemHotKey{ public delegate void HotkeyEventHandler(int HotKeyID); public class Hotkey : System.Windows.Forms.IMessageFilter { System.Collections.Hashtable keyIDs = new System.Collections.Hashtable(); I... 阅读全文
posted @ 2013-09-24 15:09 北美上映 阅读(3278) 评论(0) 推荐(0) 编辑