以下是源码,运行过后,点击command1,然后退出程序,重新调动系统,但是记事本还是没有打开,请问是什么原因?谢谢 public static bool SetAutoRun(string keyName, string filePath)
{
try
{
RegistryKey runKey = Registry.LocalMachine.OpenSubKey (@"\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true);
runKey.SetValue(keyName, filePath);
runKey.Close();
}
catch
{
return false;
}
return true;
} private void button1_Click(object sender, EventArgs e)
{
SetAutoRun("myexe", "d:\\notepad.exe"); }
}
{
try
{
RegistryKey runKey = Registry.LocalMachine.OpenSubKey (@"\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true);
runKey.SetValue(keyName, filePath);
runKey.Close();
}
catch
{
return false;
}
return true;
} private void button1_Click(object sender, EventArgs e)
{
SetAutoRun("myexe", "d:\\notepad.exe"); }
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货