判断当前程序是在调试环境下运行?

if (System.Diagnostics.Debugger.IsAttached)
            {
                this.textBox1.Text = "debug";
            }
            else

            {
                this.textBox1.Text = "NOdebug";
                
            }
原文地址:https://www.cnblogs.com/DoNetCShap/p/2564575.html