Build.Shell.run C# (CSharp) 메소드

run() 공개 정적인 메소드

public static run ( string commandName, string arguments = "" ) : void
commandName string
arguments string
리턴 void
        public static void run(string commandName, string arguments = "")
        {
            var process = new Process
            {
                StartInfo =
                {
                    FileName = commandName,
                    Arguments = arguments
                }
            };

            process.Start();
            process.WaitForExit();

            if (process.ExitCode != 0)
                throw new Exception($"Error executing command: {commandName} {arguments}");
        }