随笔分类 -  C#

摘要:一、加入命名空间using System.Diagnostics;二、启动进程//Dir所在路径private void StartPress(string Dir){ Process.Start(Dir);}二、关闭过程private void KillPress(string ProName){ ProName = ProName.ToLower(); System.Diagnostics.Process[] myProcesses = System.Diagnostics.Process.GetProcesses(); foreach (System.Diagnostics.Proces 阅读全文
posted @ 2010-04-06 11:27 EasyPass 阅读(660) 评论(0) 推荐(0)
摘要:所谓托盘程序顾名思义就是象托起的盘子一样的程序。而所谓的托起的盘子就是程序运行中显示出的图标,而托起的位置就是视窗系统的的工具栏了。托盘程序具有直观、占用屏幕空间较小并且可以为它定义多个功能菜单,这就给操作者带来了方便,所以越来越多的程序设计者都把程序设计成托盘这种方式。我们已经看过了用其他语言设计托盘程序的例子,其中的大部分,整个设计过程还是相对烦琐的。而对于微软公司极力推荐的下一代程序开发语言--Visual C#来说,却可以十分方便设计出一个托盘程序。本文就是介绍Visual C#设计托盘程序的具体过程。 首先来介绍一下本文中设计托盘程序所需要的环境: (1).微软公司视窗2000服务器 阅读全文
posted @ 2010-03-16 13:04 EasyPass 阅读(507) 评论(1) 推荐(0)
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Media;usingSystem.Resources;usingS 阅读全文
posted @ 2010-03-06 18:14 EasyPass 阅读(432) 评论(0) 推荐(0)
摘要:publicstringCreateWordFile(stringCheckedInfo){stringmessage="";try{ObjectNothing=System.Reflection.Missing.Value;Directory.CreateDirectory("C:/CNSI");//创建文件所在目录stringname="CNSI_"+DateTime.Now.ToShortString()+".doc";objectfilename="C://CNSI//"+name;// 阅读全文
posted @ 2010-01-18 11:46 EasyPass 阅读(480) 评论(0) 推荐(0)
摘要://十进制转二进制Console.WriteLine(Convert.ToString(69, 2));//十进制转八进制Console.WriteLine(Convert.ToString(69, 8));//十进制转十六进制Console.WriteLine(Convert.ToString(69, 16));//二进制转十进制Console.WriteLine(Convert.ToInt32(”100111101″, 2));//八进制转十进制Console.WriteLine(Convert.ToInt32(”76″, 8));//十六进制转十进制Console.WriteLine(C 阅读全文
posted @ 2010-01-04 10:11 EasyPass 阅读(340) 评论(0) 推荐(0)
摘要:一、判断文件夹是否存1、方法一if(Directory.Exists("d:\\pic")) { MessageBox.Show("存在");}else{ MessageBox.Show("不存在"); }2、方法二DirectoryInfoTheFolder=newDirectoryInfo("d:\\pic"); if(TheFolder.Exists) { MessageBox.Show("存在");}else{ MessageBox.Show("不存在"); }二、文 阅读全文
posted @ 2009-11-25 11:01 EasyPass 阅读(187) 评论(0) 推荐(0)