.NET Framework - Check if Windows booted in Normal or Safe Mode
.NET Framework - Check if Windows booted in Normal or Safe Mode
API Declarations
using System.Windows.Forms;
Rate .NET Framework - Check if Windows booted in Normal or Safe Mode
(2(2 Vote))
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
String msg;
switch (SystemInformation.BootMode)
{
case BootMode.FailSafe:
msg = "The computer was booted using only the basic files and drivers." + Environment.NewLine +
"This is the same as Safe Mode.";
break;
case BootMode.FailSafeWithNetwork:
msg = "The computer was booted using the basic files, drivers, and services necessary to start networking" + Environment.NewLine +
"This is the same as Safe Mode with Networking.";
break;
default:
msg = "The computer was booted in Normal mode.";
break;
}
MessageBox.Show(msg, "Windows Mode", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
.NET Framework - Check if Windows booted in Normal or Safe Mode Comments
No comments yet — be the first to post one!
Post a Comment