有时候为了让程序开机就启动,可以直接将程序复制到"启动"文件夹中. 代码: stringStartupPath=System.Environment.GetFolderPath(System.Environment.SpecialFolder.Startup);//获得文件的当前路径stringdir=Directory.GetCurrentDirectory();//获取可执行文件的全部路径stringexeDir=dir+"WindowsApplication1.exe";System.IO.File.Copy(exeDir,StartupPath+"WindowsApplication1.exe",true);