| sp; string path=string.Empty;
foreach(string arg in args) {
path+=arg;
}
path=path.Trim();
if(path.Length ==0) {
return ;
}
SoftInitRegister(path); //开始注册
}
上面的代码有问题吗? 呵呵,有问题。如何修改? 简单,把
path+=args; 改成path+=args+” “;
呵呵,很简单,自己注意一下。一些注册操作方法,这是我系统的注册方法,呵呵,漏了:)
public static void SoftInitRegister(string InstallPath) {
string ApplicationExec=InstallPath+"CEIM.EXE";//主应用程序
string ApplicationExec_Acc e= 4+"CEIM.EXE %1";//主应用程序+附件执行
//写软件安装的地方
RegistryKey regkey = Registry.CurrentUser;
RegistryKey writekey=regkey.CreateSubKey(@"Software\CEIM");
writekey.SetValue("AppBasePath",InstallPath);
//让CEIM随windows开启时自动加载
regkey = Registry.LocalMachine;
writekey=regkey.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run");
writekey.SetValue("CEIM",ApplicationExec);
//写右菜单---文件关联
regkey = Registry.ClassesRoot ;
上一页 [1] [2] [3] [4] 下一页 |