i have winform c# visual studio and a server running in linux. i want to execute this command " netstat -an | grep :80 |wc -l " from my winform interface but i have no output and i don't know where is the problem.
this is what i have tried
using System.Diagnostics;
using System.Security;
ProcessStartInfo proc_start_info = new ProcessStartInfo();
proc_start_info.FileName = "bash";
proc_start_info.Arguments = "-c netstat -an | grep :80 |wc -l ";
// -c allows to wait the command to be execute and exit
proc_start_info.RedirectStandardOutput = true;
proc_start_info.UseShellExecute = false;
proc_start_info.CreateNoWindow = true;
Process proc = new Process();
proc.StartInfo = proc_start_info;
proc.Start();
string result = proc.StandardOutput.ReadToEnd();
details_socket.Text = result;