通过注册表修改IE浏览器内核版本
摘要:static public void SetIERegistry() { try { //获取系统IE版本号 string strIEVersion = SysIeVersion(); if (string.IsNullOrEmpty(strIEVersion) || strIEVersion.Sp
阅读全文
posted @
2017-11-30 16:14
阚金翔
阅读(3284)
推荐(0) 编辑
通过Process运行bat脚本文件
摘要:Process proc = null; try { proc = new Process(); proc.StartInfo.FileName = @"C:\Users\Administrator\Desktop\script"; proc.StartInfo.Arguments = string
阅读全文
posted @
2017-11-30 16:02
阚金翔
阅读(1118)
推荐(0) 编辑
窗体抖动
摘要://实现窗体抖动的效果 Point first = this.Location; for (int i = 0; i < 30; i++) { Random ran = new Random(); Point p = new Point(this.Location.X + ran.Next(10)
阅读全文
posted @
2017-11-30 13:38
阚金翔
阅读(186)
推荐(0) 编辑
OpenFileDialog和SaveFileDialog的简单使用
摘要://文件名 private string curFileName; //图像对象1 private Bitmap curBitmap; //将本地图片保存到pictureBox中 private void button1_Click(object sender, EventArgs e) { Ope
阅读全文
posted @
2017-11-29 14:57
阚金翔
阅读(1193)
推荐(0) 编辑
屏幕截屏
摘要://获得当前屏幕的分辨率 Rectangle rc = sc.Bounds; int iWidth = rc.Width; int iHeight = rc.Height; //创建一个和屏幕一样大的Bitmap Bitmap myImage = new Bitmap(iWidth, iHeight
阅读全文
posted @
2017-11-29 14:37
阚金翔
阅读(171)
推荐(0) 编辑
通过注册表实现开机自启的取消
摘要:一、添加引用 using Microsoft.Win32;//添加的引用 二、开启和关闭的方法 string path = Application.ExecutablePath; RegistryKey rk = Registry.LocalMachine; RegistryKey rk2 = rk
阅读全文
posted @
2017-11-28 17:26
阚金翔
阅读(739)
推荐(0) 编辑
判断字符串是否为空的几种方法
摘要:string str = string.Empty;if (str == ""){ }else { } if (str == string.Empty){ }else { } if (str.Length == 0)//效率最高{ }else { } if (string.IsNullOrEmpty
阅读全文
posted @
2017-11-28 09:21
阚金翔
阅读(2255)
推荐(0) 编辑
重命名文件
摘要:Computer MyComputer = new Computer();MyComputer.FileSystem.RenameFile(FileName, newFileName);//其中FileName是你所要重命名的文件的全路径,newFileName仅仅是目标文件名。 创建于2017年2
阅读全文
posted @
2017-11-28 09:20
阚金翔
阅读(130)
推荐(0) 编辑