xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

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

資源簡(jiǎn)介

.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();
?????

評(píng)論

共有 條評(píng)論