Parsi Coders

نسخه‌ی کامل: سورس کد چک کردن وضعیت سیستم عامل (ویژوال بیسیک دات نت)
شما در حال مشاهده نسخه آرشیو هستید. برای مشاهده نسخه کامل کلیک کنید.
.NET Framework - Check if Windows booted in Normal or Safe Mode

با سورس زیر میتونید بفهمید که ایا ویندوز شما در حالت نرمال هست یا safe mode !

کد:
using System;
using System.Windows.Forms;


Code



کد:
namespace TestApp
{
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);
}
}
}