http://community.csdn.net/Expert/topic/4327/4327795.xml?temp=.1075556
http://community.csdn.net/Expert/topic/4255/4255732.xml?temp=.9858362
/// <summary>
/// 设置能否开机自动运行状态
/// </summary>
/// <param name="IsAuto">是否能够自动运行</param>
public void SetAutoExec(bool IsAuto)
{
RegistryKey Reg =Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run",true);
if(IsAuto)
{
string sFilePath = Application.ExecutablePath;
Reg.SetValue("名字",sFilePath);
}
else
{
if(IsAuto==false) Reg.DeleteValue("名字");
}
}
http://community.csdn.net/Expert/topic/4255/4255732.xml?temp=.9858362
/// <summary>
/// 设置能否开机自动运行状态
/// </summary>
/// <param name="IsAuto">是否能够自动运行</param>
public void SetAutoExec(bool IsAuto)
{
RegistryKey Reg =Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run",true);
if(IsAuto)
{
string sFilePath = Application.ExecutablePath;
Reg.SetValue("名字",sFilePath);
}
else
{
if(IsAuto==false) Reg.DeleteValue("名字");
}
}
浙公网安备 33010602011771号