Skip to content

Instantly share code, notes, and snippets.

View leslietoo's full-sized avatar

Masked Lion leslietoo

View GitHub Profile
@leslietoo
leslietoo / ProcessAsyncHelper.cs
Created May 9, 2022 11:45 — forked from NSouth/ProcessAsyncHelper.cs
The right way to run external process in .NET (async version)
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Threading.Tasks;
/// <summary>
/// Process helper with asynchronous interface
/// - Based on https://gist.github.com/Indigo744/b5f3bd50df4b179651c876416bf70d0a
/// - And on https://stackoverflow.com/questions/470256/process-waitforexit-asynchronously
/// </summary>