public static bool SetAutoRun(string keyName, string filePath)
        {
            try
            {
                RegistryKey runKey = Registry.LocalMachine.OpenSubKey(@"\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true);
                runKey.SetValue(keyName, filePath); //未将对象引用设置到对象实例 (报错)
                runKey.Close();
            }
            catch (Exception err)
            {
                return false;
            }
            return true;
        }
keyName="qq";
filePath="G:\xiao\qc\Bin\QQ.exe";
如可解决?谢谢