Kalpesh Chhatrala
asked on
Running in IDE or EXE in C# VS 2010
How can We Find Code is executed from IDE or EXE ?
thanks
thanks
ASKER
but i wan to check inside from application not from task manager.
get the list of all running process using this:
http://www.howtogeek.com/howto/programming/get-a-list-of-running-processes-in-c/
and check for exename.vshost.exe in the list.
http://www.howtogeek.com/howto/programming/get-a-list-of-running-processes-in-c/
and check for exename.vshost.exe in the list.
ASKER
but how can i match myapplcation exe with process list.
or is any another way ?
or is any another way ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
or just check debugger.isattached
The way most people do it is with the following property:
// Sample for the Environment.UserInteractive property
using System;
class Sample
{
public static void Main()
{
Console.WriteLine();
Console.WriteLine("UserInteractive: {0}", Environment.UserInteractive);
}
}
/*
This example produces the following results:
UserInteractive: True
*/
ASKER
Thanks
exename.vshost.exe (it is run from your IDE)
if it says just exename.exe (it is run directly using the exe)