C# 偵測登錄資料庫有無相關紀錄值
C# 偵測登錄資料庫有無相關紀錄值
關鍵字:RegistryKey、OpenSubKey、GetValue
RegistryKey loca = Registry.LocalMachine;
RegistryKey run = loca.OpenSubKey(@”SOFTWARE\Microsoft\Windows\CurrentVersion\Run”);
String pathString = (string)run.GetValue(“csbootrun”);
if (pathString != null)
{
checkBox_Base1.Checked = true;
}
else
{
checkBox_Base1.Checked = false;
}