系统启动后,自动启动软件方法.

可以通过修改注册表来实现
代码如下:
        private void InitializeRegis()
        
{
            
string fileName = Application.StartupPath;
            RegistryKey rkey 
= Registry.LocalMachine;
            RegistryKey rkey1 
= rkey.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run"true);
            rkey1.SetValue(
"ExcTol", fileName + @"\ExcelTol.exe");
            rkey1.Close();
        }
加入以下namespace
using Microsoft.Win32;

posted on 2006-08-02 08:43  ★金★  阅读(416)  评论(3编辑  收藏  举报

导航