79135743

Date: 2024-10-29 03:25:31
Score: 0.5
Natty:
Report link

After my test, you need to initialize this tool first, just double-click the following:

enter image description here 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:

enter image description here

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Cody Liang