Pushing up initial 1.0 version.
This commit is contained in:
16
Process.Net.Example/Process.Net.Example.csproj
Normal file
16
Process.Net.Example/Process.Net.Example.csproj
Normal file
@ -0,0 +1,16 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
<Nullable>disable</Nullable>
|
||||
<AssemblyName>MontoyaTech.Process.Net.Example</AssemblyName>
|
||||
<RootNamespace>MontoyaTech.Process.Net.Example</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Process.Net\Process.Net.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
27
Process.Net.Example/Program.cs
Normal file
27
Process.Net.Example/Program.cs
Normal file
@ -0,0 +1,27 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user