add check if application is running

This commit is contained in:
Jakob 2019-11-09 19:48:21 +01:00
parent bcf11b4d79
commit 802b2daaaf
2 changed files with 19 additions and 6 deletions

View file

@ -1,12 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Management;
using System.Net;
using System.IO;
using IWshRuntimeLibrary;
using System.Diagnostics;
namespace EnvyUpdate
{
@ -86,5 +83,17 @@ namespace EnvyUpdate
shortcut.TargetPath = targetFileLocation;
shortcut.Save();
}
public static bool IsProcessOpen(string name)
{
foreach (Process clsProcess in Process.GetProcesses())
{
if (clsProcess.ProcessName.Contains(name))
{
return true;
}
}
return false;
}
}
}