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;
}
test: SetAutoRun("myexe","c:\\text.exe");
相关文章:
-
2021-08-12
-
2022-12-23
-
2022-12-23
-
2021-10-20
-
2022-12-23
-
2021-10-03
-
2022-12-23
-
2021-07-26
猜你喜欢
-
2021-07-09
-
2021-07-29
-
2021-06-09
-
2021-11-29
-
2021-11-30
-
2022-01-20
-
2022-12-23
相关资源
-
下载
2023-01-24
-
下载
2021-06-24
-
下载
2022-12-06
-
下载
2023-02-17