简体   繁体   English

执行.reg文件[c#]

[英]Executing .reg file [c#]

I'm trying to execute a .reg file from c# program. 我正在尝试从C#程序执行.reg文件。 I understood that the following code should work: 我了解以下代码应该可以工作:

 string filepath = "C:\\Users\\...\\test.reg";
 Process regeditProcess = Process.Start("regedit.exe" , filepath);
 regeditProcess.WaitForExit();

but it doesn't! 但事实并非如此! I see a message of a successful keys creation in regitsry, but I don't see it was really added. 我看到一条有关成功创建密钥的消息,但是我看不到它是真正添加的。

thanks for any help. 谢谢你的帮助。

If regedit tells you that the values were added, but you cannot see them, then most likely the registry redirector is confusing you. 如果regedit告诉您已添加了值,但看不到它们,则很可能是注册表重定向器使您感到困惑。 In other words, you are hoping to import into the 64 bit view, but import into the 32 bit view, or vice versa. 换句话说,您希望导入到64位视图中,但是希望导入到32位视图中,反之亦然。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM