Advertisement
Guest User

Untitled

a guest
May 27th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. class SurroundingClass
  2. {
  3. private Process[] p;
  4.  
  5. private void CheckIfRunning()
  6. {
  7. p = Process.GetProcessesByName("Fiddler.exe");
  8. if (p.Count() > 0)
  9. Application.Exit();
  10. else
  11. {
  12. }
  13. }
  14.  
  15. private void FiddlerCheck()
  16. {
  17. string pName = "Fiddler";
  18. Process[] psList;
  19. try
  20. {
  21. psList = Process.GetProcesses();
  22. foreach (Process p in psList)
  23. {
  24. if ((pName == p.ProcessName))
  25. {
  26. Application.Exit();
  27. }
  28. }
  29. }
  30. catch (Exception ex)
  31. {
  32. }
  33. }
  34. private void FiddlerCheck2()
  35. {
  36. try
  37. {
  38. Process[] x;
  39. x = Process.GetProcesses();
  40. foreach (Process p in x)
  41. {
  42. if (p.MainWindowTitle.Contains("Fiddler"))
  43. p.Kill();
  44. }
  45. }
  46. catch
  47. {
  48. }
  49. }
  50.  
  51. private void WiresharkCheck()
  52. {
  53. string pName = "Wireshark";
  54. Process[] psList;
  55. try
  56. {
  57. psList = Process.GetProcesses();
  58. foreach (Process p in psList)
  59. {
  60. if ((pName == p.ProcessName))
  61. {
  62. Application.Exit();
  63. }
  64. }
  65. }
  66. catch (Exception ex)
  67. {
  68. }
  69. }
  70. private void WiresharkCheck2()
  71. {
  72. try
  73. {
  74. Process[] x;
  75. x = Process.GetProcesses();
  76. foreach (Process p in x)
  77. {
  78. if (p.MainWindowTitle.Contains("Wireshark"))
  79. p.Kill();
  80. }
  81. }
  82. catch
  83. {
  84. }
  85. }
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement