06 2011 档案

摘要://获取启动了应用程序的可执行文件的路径,不包括可执行文件的名称。 string str5=Application.StartupPath;//可获得当前执行的exe的文件名。 string str1 =Process.GetCurrentProcess().MainModule.FileName;// 获取和设置当前目录(即该进程从中启动的目录)的完全限定路径。 // 备注 按照定义,如果该进程在本地或网络驱动器的根目录中启动,则此属性的值为驱动器名称后跟一个尾部反斜杠(如“C:\”)。如果该进程在子目录中启动,则此属性的值为不带尾部反斜杠的驱动器和子目录路径(如“C:\mySubDirec 阅读全文
posted @ 2011-06-29 09:44 biubiubiu 阅读(274) 评论(0) 推荐(1)
摘要:private void pictureBox1_MouseMove(object sender, MouseEventArgs e){ int originalWidth = this.pictureBox1.Image.Width; int originalHeight = this.pictureBox1.Image.Height; PropertyInfo rectangleProperty = this.pictureBox1.GetType().GetProperty("ImageRectangle", BindingFlags.Instance | Bindi 阅读全文
posted @ 2011-06-23 12:45 biubiubiu 阅读(239) 评论(0) 推荐(0)
摘要:/// <summary> /// 获取字符串中数字 /// </summary> /// <param name="str"></param> /// <returns></returns> public int GetNumberInt(string str) { int result = 0; if (str != null && str != string.Empty) { // 正则表达式剔除非数字字符(不包含小数点.) str = Regex.Replace(str, @&q 阅读全文
posted @ 2011-06-14 12:06 biubiubiu 阅读(312) 评论(0) 推荐(1)
摘要:以下代码是我的项目中拷贝出来的,已通过测试成功,代码如下://首先建立一个抽象类,做为基类,试过用接口,但没有成功,所以放弃//抽象类: public abstract class IMCU05SConfig { public abstract bool AddMcu(HJEquipType equiptype, ZHNode node); public abstract bool EditMcu(HJMCU mcu); }因为项目需要,是利用动态加载DLL的方式,需要自定义配置窗体,所以新建一个类库,将窗体写在当中,然后实现抽象类用于调用,代码如下: public class McuConf 阅读全文
posted @ 2011-06-01 16:11 biubiubiu 阅读(259) 评论(0) 推荐(0)