判断当前程序是在调试环境下运行? if (System.Diagnostics.Debugger.IsAttached) { this.textBox1.Text = "debug"; } else { this.textBox1.Text = "NOdebug"; }