private bool IsVisualStudioRunning()
{
System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcesses();
try
{
foreach (System.Diagnostics.Process p in processes)
{
if (p != null && p.MainModule != null)
{
String fileName = Path.GetFileName(p.MainModule.FileName);
if (String.Compare(fileName, "devenv.exe", true) == 0)
return true;
}
}
}
catch
{
}
return false;
}
|