What is the best way in c# to determine whether the programmer is running the program via IDE or its user?
Yes, it's a bit odd that you can get a loud consensus that K&R is a great C book, and also a loud consensus that C99 is the correct/current/best version of C.
step 1:Understand the problem by reading several times until you understand. step 2: Think logic of the problem. step 3: Put a pen on paper and write algorithm for that problem by applying your logic. step 4:Then convert the algorithm in C code.
if (System.Diagnostics.Debugger.IsAttached) { // You are debugging }
public static bool IsInVisualStudio { get { bool inIDE = false; string[] args = System.Environment.GetCommandLineArgs(); if (args != null && args.Length > 0) { string prgName = args[0].ToUpper(); inIDE = prgName.EndsWith("VSHOST.EXE"); } return inIDE; } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With