List process by port number netstat -ano | findstr 8080 Proto Local Address Foreign Address State PID TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 29848 -a – Displays all connections and listening ports. -o – Displays the owning process ID associated with ea
private void t_btn_kill_Click(object sender, EventArgs e) { int port; bool b = int.TryParse(t_txt_guardport.Text, out port); if (!b) { MessageBox.Show("请输入正确的监听端口"); return; } Process p = new Process(); p.StartInfo.FileName = "cmd.exe"