先谢过了

解决方案 »

  1.   

    用c#编写的程序如何在liunix上跑
      

  2.   


               using Microsoft.Win32;           string strName = Application.ExecutablePath;
                if (!File.Exists(strName))
                    return;
                string strnewname = strName.Substring(strName.LastIndexOf("\\") + 1);//获取执行文件名
                RegistryKey RKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CURRENTVERSION\\Run", true);
                if (RKey == null)
                    RKey = Registry.LocalMachine.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CURRENTVERSION\\Run");
                RKey.SetValue(strnewname, strName);
                MessageBox.Show("开机生效");