zoukankan
html css js c++ java
ASP.NET运行.bat文件
//
Create the ProcessInfo object
System.Diagnostics.ProcessStartInfo psi
=
new
System.Diagnostics.ProcessStartInfo(
"
cmd.exe
"
);
psi.UseShellExecute
=
false
;
psi.RedirectStandardOutput
=
true
;
//
psi.RedirectStandardInput = true;
psi.RedirectStandardError
=
true
;
psi.Arguments
=
"
/K C:\\temp\\test.bat
"
;
psi.WorkingDirectory
=
"
c:\\temp\\
"
;
//
Start the process
System.Diagnostics.Process proc
=
System.Diagnostics.Process.Start(psi);
//
Attach the output for reading
System.IO.StreamReader sOut
=
proc.StandardOutput;
proc.Close();
//
Read the sOut to a string.
string
results
=
sOut.ReadToEnd().Trim();
sOut.Close();
//
Write out the results.
string
fmtStdOut
=
"
<font face=courier size=0>{0}</font>
"
;
this
.Response.Write(String.Format(fmtStdOut, results.Replace(System.Environment.NewLine,
"
<br>
"
)));
查看全文
相关阅读:
[Unity3D]蓝港面试题
BZOJ 2186 SDOI2008 沙拉公主的困惑 数论
JSONObject与JSONArray的使用
一个int类型究竟占多少个字节
软件开发的金字塔
poj 1064 Cable master ,二分 精度!!!
php实现工厂模式
数据库索引的作用和长处缺点
C++中使用class和structkeyword的不同
提交时提示错误This Bundle is invalid.New apps and app updates submitted to the App Store must be built wit
原文地址:https://www.cnblogs.com/top5/p/1681287.html
最新文章
js split str.split(" "); split使用方法 在某处截字符串
【git学习五】git基础之git分支
关于PCA算法的一点学习总结
log4net使用具体解释
怎样推断一棵二叉树是全然二叉树
cacti气象图调整(批量位置调整、更改生成图大小等)
压缩页面元素
IOS成长之路-Nsstring中搜索方法rangeOfString
什么是依赖注入
java.lang.Runnable接口
热门文章
我的Hook学习笔记
【剑指offer】左旋转字符串
struts2标签具体解释
FLEX中Tree默认展开全部节点
phoneGap开发环境搭建(android)
缓存溢出问题简述
我是怎样成长为系统架构师的
C++类的继承实例
SWTBOK測试实践系列(4) -- 软件測试技术的黑白之道
Windows下载Android源代码
Copyright © 2011-2022 走看看