判斷程序是不是調試狀態

 public LoginForm()
        {
            InitializeComponent();

            //判斷是否調試狀態
            Process currentProcess = Process.GetCurrentProcess();//獲取當前進程
            //獲取當前運行程序徹底限定名
            string currentFileName = currentProcess.MainModule.FileName;
            if (currentFileName.EndsWith("vshost.exe"))
            {
                GlobalVar.IsDebug = true;
            }
            else
            {
                GlobalVar.IsDebug = false;
               
            }
        }
相關文章
相關標籤/搜索