■ SystemInformation 클래스의 BootMode 정적 속성을 사용해 Windows 안전 모드 여부를 구하는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 |
using System.Windows.Forms; BootMode mode = SystemInformation.BootMode; if(mode != BootMode.Normal) { MessageBox.Show("이 프로그램은 안전 모드에서 작동하지 않습니다."); Application.Exit(); } |