关键词搜索

源码搜索 ×
×

c#检测进程是否存在并关闭

发布2020-12-26浏览2640次

详情内容

  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Diagnostics;
  9. using System.Windows.Forms;
  10. namespace WindowsFormsApplication3
  11. {
  12. public partial class Form1 : Form
  13. {
  14. public Form1()
  15. {
  16. InitializeComponent();
  17. }
  18. private void button1_Click(object sender, EventArgs e)
  19. {
  20. Process[] ps = Process.GetProcessesByName("chrome");
  21. if (ps.Length > 0)
  22. {
  23. foreach (Process p in ps)
  24. p.Kill();
  25. }
  26. }
  27. }
  28. }

 

相关技术文章

点击QQ咨询
开通会员
返回顶部
×
微信扫码支付
微信扫码支付
确定支付下载
请使用微信描二维码支付
×

提示信息

×

选择支付方式

  • 微信支付
  • 支付宝付款
确定支付下载