All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
九 表格 Tables_[Html教程]
利用ASP.NET,DataGrid显示主次关系的数据_[Asp.Net教程]
Net2005中的MD5加密_[Asp.Net教程]
HTML语言剖析(一)Html简介_[Html教程]
XML入门教程-XML CDATA_[XML教程]
delphi类中的方法是用实例-方法
发布一个好用的类SafeConvert,,用于值类型装换_.net资料_编程技术
Asp.Net图片验证码程序[含源码]_[Asp.Net教程]
PHP实现简单线性回归之数学库的重要性_[PHP教程]
Asp.net中创建和使用Ado.net_[Asp.Net教程]
Reading number is top 10 pictures
超级大兔子
到南昌西站了1
漂亮脸蛋魔鬼身材1
A beautiful girl to bud3
Distribution of wealth in China survey status report
职场回春术
Sell the barbecue as says father du breul3
一个武林高手的故事
这只猪到底犯了什么错?
运动的范冰冰2
Download software ranking
Twenty piece of palm leaf
c#程序设计案例教程
变速齿轮3.26
Kung.Fu.Panda.2
Unix video tutorial1
Visual C++界面编程技术
WebService在.NET中的实战应用教学视频 → 第1集
天龙八部十二宫服务端
Tram sex maniac 2 (H) rar bag7
软件工程思想
delv published in(发表于) 2014/1/6 9:05:48 Edit(编辑)
C#,中启动进程的三种方法_[Asp.Net教程]

C#,中启动进程的三种方法_[Asp.Net教程]

C# 中启动进程的三种方法_[Asp.Net教程]

1.启动子进程,不等待子进程结束
private void simpleRun_Click(object sender, System.EventArgs e)
{ System.Diagnostics.Process.Start(@"C:\listfiles.bat");
}
2.启动子进程,等待子进程结束,并获得输出
1private void runSyncAndGetResults_Click(object sender, System.EventArgs e)
2{
3 System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(@"C:\listfiles.bat");
4 psi.RedirectStandardOutput = true;
5 psi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
6 psi.UseShellExecute = false;
7 System.Diagnostics.Process listFiles;
8 listFiles = System.Diagnostics.Process.Start(psi);
9 System.IO.StreamReader myOutput = listFiles.StandardOutput;
10 listFiles.WaitForExit(2000);
11
12 if (listFiles.HasExited)
13 {
14 string output = myOutput.ReadToEnd();
15 this.processResults.Text = output;
16 }
17}
183.使用默认的浏览器打开URL
1private void launchURL_Click(object sender, System.EventArgs e)
2{
3 string targetURL = @http://www.duncanmackenzie.net;
4 System.Diagnostics.Process.Start(targetURL);
5}


来源:网络







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.