就是利用注册表 实现自动运行登录按钮,最好有源代码可以参考 拜托了。。

解决方案 »

  1.   

    你是要程序自动运行呢还是自动登录呢
    自动运行
     string R_startPath = Application.ExecutablePath;
            if (checkBox1.Checked == true)
            {
                RegistryKey R_local = Registry.LocalMachine;
                RegistryKey R_run = R_local.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run");
                R_run.SetValue("BirthdayTipF", R_startPath);
                R_run.Close();
                R_local.Close();
                MessageBox.Show("成功!");
            }
            else
            {
                try
                {
                    RegistryKey R_local = Registry.LocalMachine;
                    RegistryKey R_run = R_local.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run");
                    R_run.DeleteValue("BirthdayTipF", false);
                    R_run.Close();
                    R_local.Close();
                    MessageBox.Show("成功!");
                }
                catch (Exception ex)
                {
                    MessageBox.Show("您需要管理员权限修改", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    throw;
                }        }
    自动登录就不说了
      

  2.   

     R_run.SetValue("BirthdayTipF", R_startPath);
    参数一:程序名
    参数二:路径