After my test, you need to initialize this tool first, just double-click the following:
Then enter the C# Interactive window. It is wrong to directly use the Process.Start("ping") command. You need to use the following code in the C# Interactive window:
var startInfo = new ProcessStartInfo
{
FileName = "ping",
Arguments = "",
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true,
};
using (var process = Process.Start(startInfo))
{
using (var reader = process.StandardOutput)
{
string result = reader.ReadToEnd();
Console.WriteLine(result);
}
}
This will achieve what you want: