以下代码删除了注册表项,但从未进入 for 循环(它应该进入,因为它会检查该值是否已被删除)为什么会这样?(我使用的是 Windows 10 - 64 位)当我导航到那里时,LocalMachine\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run我看不到任何HackerOne扫描仪值!(我创建后就检查过)
RegistryKey rk1 = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
rk1.DeleteValue("HackerOne Scanner", false);
if (Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", "true", true) == null)
{
try
{
RegistryKey rk = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
rk.SetValue("HackerOne Scanner", Application.ExecutablePath);
}
catch { MessageBox.Show("Admin Rights Are Required"); Application.Exit(); }
}
慕工程0101907
GCT1015
随时随地看视频慕课网APP
相关分类