zoukankan
html css js c++ java
开篇第一篇文章:启动Cmd执行指定的命令并返回执行的结果
这个算是一个文章
执行指定的Cmd命令,并获取执行结果
Code
1
using
System.Diagnostics;
2
3
/**/
///
<summary>
4
///
启动Cmd并执行指定的命令,并返回执行的结果
5
///
</summary>
6
///
<param name="strCommand">
命令文件
</param>
7
///
<returns>
执行结果
</returns>
8
private
string
ShellStart(
string
strCommand)
9
{
10
ProcessStartInfo psi
=
new
ProcessStartInfo(
"
cmd
"
);
11
psi.Arguments
=
"
/c
"
+
strCommand;
12
psi.RedirectStandardInput
=
true
;
13
psi.RedirectStandardOutput
=
true
;
14
psi.CreateNoWindow
=
true
;
15
psi.UseShellExecute
=
false
;
16
Process p
=
new
Process();
17
p.StartInfo
=
psi;
18
p.Start();
19
return
p.StandardOutput.ReadToEnd();
20
}
查看全文
相关阅读:
windows查看和杀死占用端口的进程
jenkins html报告不显示样式
解决git一直输入用户名和密码的问题
git中文乱码问题
java环境变量配置
web service
sql 训练及总结
js 及jQery
[TYVJ] P1015 公路乘车
GIT 基本用法
原文地址:https://www.cnblogs.com/bwch_xm/p/1498823.html
最新文章
iOS 自动布局总结
iOS NavigaitonController详解(code版)
DLL-使用DLL
DLL-创建DLL
动态链接库基本概念
COM笔记-类厂
COM笔记-CoCreateInstance
COM笔记-COM库函数
COM笔记-Widows 注册表
COM笔记-关于GUID
热门文章
COM笔记-关于HRESULT
COM笔记-动态链接
有1、2、3、4个数字,能组成多少个互不相同且无重复数字的三位数,都是多少?
九九乘法表
python OSError: [Errno 22] Invalid argument: 'D:\crawlex01.html1'
python 最简单的爬虫
求1-50的偶数和,和奇数和
while 解决 10000米绳子 对折当 绳长小于5米时求绳的对折次数
操作系统
virtueBox实现虚拟机的复制和粘贴
Copyright © 2011-2022 走看看