2013年1月13日
摘要: System.Diagnostics.Process.Start(); 能做什么呢?它主要有以下几个功能:1、打开某个链接网址(弹窗)。2、定位打开某个文件目录。3、打开系统特殊文件夹,如“控制面板”等。那么它是怎么实现这几个功能的呢?在讲应用前,我们先来看看Process.Star()的构造方法。名称说明Process.Start () 启动(或重用)此 Process 组件的 StartInfo 属性指定的进程资源,并将其与该组件关联。Process.Start (ProcessStartInfo)启动由包含进程启动信息(例如,要启动的进程的文件名)的参数指定的进程资源,并将该资源与新的 阅读全文
posted @ 2013-01-13 20:50 武胜-阿伟 阅读(47149) 评论(2) 推荐(10) 编辑
摘要: 以下的代码为new Process() 调用cmd命令,并将结果异步回显到Form的例子:[csharp] view plaincopyusingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Diagnostics;namespaceCmdCallbackShow{//1.定义委托publicd 阅读全文
posted @ 2013-01-13 20:48 武胜-阿伟 阅读(6705) 评论(1) 推荐(2) 编辑
摘要: 有时子窗体的操作需要实时调用父窗体中的控件操作,比如在父窗体的文本框中显示子窗体中的输出:主窗体:[csharp] view plaincopyMainForm.cs:publicpartialclassMainForm:Form{publicMainForm(){InitializeComponent();}privatevoidbutton1_Click(objectsender,EventArgse){SubFormSubForm=newSubForm();//3.将ChangeTextVal加入到委托事件中//等效于://SubForm.ChangeTextVal+=ChangeTex 阅读全文
posted @ 2013-01-13 20:47 武胜-阿伟 阅读(5796) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.ComponentModel;using System.Drawing;using System.Data;using System.Text;using System.Windows.Forms;using System.Diagnostics;using System.Runtime.InteropServices;using System.IO;using System.Drawing.Design;namespace HCDL{ public class ShowFor 阅读全文
posted @ 2013-01-13 20:33 武胜-阿伟 阅读(680) 评论(0) 推荐(0) 编辑