C#程序里怎么获得命令提示符的返回消息以及在程序内部使用命令提示符(即不出现黑框)

来源:百度知道 编辑:UC知道 时间:2024/06/24 13:23:35
C#程序里怎么获得命令提示符的返回消息以及在程序内部使用命令提示符(即不出现黑框)

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using System.Runtime.InteropServices;

using System.Diagnostics;

namespace WindowsApplication1

{

    public partial class Form1 : Form

    {

        [DllImport("user32.dll", EntryPoint = "ShowWindow", SetLastError = true)]

        static extern bool ShowWindow(IntPtr hWnd, uint nCmdShow);

        [DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)]