title: Netstat focus on (find port)
body: <p>Im recently trying to execute the following line ;</p>
  
  <pre><code>string strCmdText;
  strCmdText = "netstat -np TCP | find " + quote + number + quote + "";
  System.Diagnostics.Process.Start("netstat.exe", strCmdText);
  
  Logs.Write("LISTEN_TO(" + Registry_val1.Text + ")", strCmdText);
  </code></pre>
  
  <p>now what this has to do is basicly find all TCP ports that contain '80' in them and show them up in my custom-made log system that will make a logbook in my folder called;</p>
  
  <p>LISTEN_TO(80)-{date_time}.txt
  inside this .txt it should contain the command issued text, however all i get is a time.</p>
  
  <p>i debugged this command as above, and unfortunately all i know is that the CMDtext is set correctly, and that my logging system works correctly, leaving me with no choice that NETSTAT may be closed as soon as the query is launched?</p>
  
  <p>hopefully i provided anough information, as this is my first post.</p>
  
  <p>Regards,</p>
  
  <p>Co</p>
  
  <p>Due to vague description, here's an other-sort same code i tried to do, however still remain getting only a time.</p>
  
  <pre><code>const string quote = "\"";
  Process p = new Process();
  p.StartInfo.FileName = "cmd";
  p.StartInfo.Arguments = "netstat -np TCP | find " + quote + number + quote + "";
  p.StartInfo.CreateNoWindow = true;
  p.StartInfo.RedirectStandardOutput = true;
  p.StartInfo.UseShellExecute = false;
  p.Start();
  
  String output = p.StandardOutput.ReadToEnd();
  
  Logs.Write("LISTEN_TO(" + Registry_val1.Text + ")", output);
  </code></pre>
  
  <p>basicly, you could see this as; textbox1.text = output; execpt now the output is being putten to a log file.</p>