28 lines
728 B
C#
28 lines
728 B
C#
|
using System;
|
|||
|
using System.Diagnostics;
|
|||
|
|
|||
|
namespace MontoyaTech.Process.Net.Example
|
|||
|
{
|
|||
|
public class Program
|
|||
|
{
|
|||
|
public static void Main(string[] args)
|
|||
|
{
|
|||
|
Console.WriteLine("Starting process");
|
|||
|
|
|||
|
var startInfo = new ProcessStartInfo()
|
|||
|
{
|
|||
|
FileName = "cmd.exe",
|
|||
|
RedirectStandardInput = true,
|
|||
|
};
|
|||
|
|
|||
|
var process = WinProcess.Create(startInfo, creationFlags: WinProcess.CreationFlags.CREATE_NEW_CONSOLE);
|
|||
|
|
|||
|
process.StandardInput.WriteLine("This is a test");
|
|||
|
process.StandardInput.WriteLine("Does this work?");
|
|||
|
|
|||
|
Console.WriteLine("Done.");
|
|||
|
Console.ReadLine();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|