2014-05-04
WPY电脑定时重启工具源码
WPY电脑定时重启工具源码源码描述:服务器的重启,需要API来实现。共享此案例,希望多交流。//将程序的开机启动写入注册表privatevoidregister(){stringstarupPath=Application.ExecutablePath;//Mydir(verro.exe);////classMicosoft.Win32.RegistryKey.表示Window注册表中项级节点,此类是注册表装.RegistryKeyloca=Registry.LocalMachine;RegistryKeyrun=loca.CreateSubKey(@SOFTWARE\Microsoft\Windows\CurrentVersion\Run);try{run.SetValue(ResetWin,starupPath);MessageBox.Show(开机启动设置成功!,提示,MessageBoxButtons.OK,MessageBoxIcon.Information);loca.Close();run.Close();}catch(Exceptionee){MessageBox.Sh