Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# net framework中的哪个库可用于执行程序?_C# - Fatal编程技术网

C# net framework中的哪个库可用于执行程序?

C# net framework中的哪个库可用于执行程序?,c#,C#,我想编写一个具有以下功能的程序: 用户执行程序(C#中的控制台应用程序),键入程序名,然后按Enter键,程序应初始化。此功能内置于.NET核心,无需外部库: 请查看过程类。这应该让你开始,如果你有任何问题,发表另一个问题 以下是链接MSDN文档中的示例: using System; using System.Diagnostics; using System.ComponentModel; namespace MyProcessSample { class MyProcess

我想编写一个具有以下功能的程序:
用户执行程序(C#中的控制台应用程序),键入程序名,然后按Enter键,程序应初始化。

此功能内置于.NET核心,无需外部库:


请查看
过程
类。这应该让你开始,如果你有任何问题,发表另一个问题

以下是链接MSDN文档中的示例:

using System;
using System.Diagnostics;
using System.ComponentModel;

namespace MyProcessSample
{
    class MyProcess
    {
        public static void Main()
        {
            Process myProcess = new Process();

            try
            {
                myProcess.StartInfo.UseShellExecute = false;

                // You can start any process.
                // HelloWorld is a do-nothing example.
                myProcess.StartInfo.FileName = "C:\\HelloWorld.exe";
                myProcess.StartInfo.CreateNoWindow = true;
                myProcess.Start();

                // This code assumes the process you are starting will 
                // terminate itself.  
                //
                // Given that is is started without a window so you cannot 
                // terminate it on the desktop, it must terminate itself 
                // or you can do it programmatically from this application 
                // using the Kill method.
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
    }
}

就这一次,我给你密码。如果你想让你的发射器更复杂,那就由你决定了

class Program
{
    public static void Main(string[] args)
    {
        Process process = new Process();
        process.StartInfo.FileName = args[0];
        process.StartInfo.UseShellExecute = false;
        process.StartInfo.CreateNoWindow = true;
        process.Start();
    }
}

我相信windows控制台可以做到这一点。