Advertisement
SplittyDev

Untitled

Feb 11th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. using System;
  2. using System.Diagnostics;
  3. namespace Procces_manager
  4. {
  5.     class MainClass
  6.     {
  7.         public static void Main (string[] args) {
  8.             var file = "skype";
  9.             var running = IsProcessRunning (file);
  10.             Console.WriteLine ("{0} is {1}", file, running ? "running" : "not running");
  11.             Console.Read ();
  12.         }
  13.  
  14.         // Process Check
  15.         public static bool IsProcessRunning (string name) {
  16.             return Process.GetProcessesByName (name).Length != 0;
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement