91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 2KB
    文件類型: .cs
    金幣: 1
    下載: 1 次
    發(fā)布日期: 2021-06-17
  • 語言: C#
  • 標(biāo)簽: c#??cmd??.net??

資源簡介

.net調(diào)用系統(tǒng)cmd指令類,內(nèi)含直接調(diào)用cmd指令得到返回內(nèi)容的方法

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;
using?System.Diagnostics;

namespace?BRS
{
????///?
????///?Cmd?的摘要說明。
????///?

????public?class?Cmd
????{
????????private?Process?proc?=?null;
????????///?
????????///?構(gòu)造方法
????????///?

????????public?Cmd()
????????{
????????????proc?=?new?Process();
????????}
????????///?
????????///?執(zhí)行CMD語句
????????///?

????????///?要執(zhí)行的CMD命令
????????public?string?RunCmd(string?cmd)
????????{
????????????proc.StartInfo.CreateNoWindow?=?true;
????????????proc.StartInfo.FileName?=?“cmd.exe“;
????????????proc.StartInfo.UseShellExecute?=?false;
????????????proc.StartInfo.RedirectStandardError?=?true;
????????????proc.StartInfo.RedirectStandardInput?=?true;
????????????proc.StartInfo.RedirectStandardOutput?=?true;
????????????proc.Start();
????????????proc.StandardInput.WriteLine(cmd);
????????????proc.StandardInput.WriteLine(“exit“);
????????????string?outStr?=?proc.StandardOutput.ReadToEnd();
?????

評論

共有 條評論