在运行时创建/修改注册表 [英] Create / Modify the Registry at runtime

查看:81
本文介绍了在运行时创建/修改注册表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在做的部分控制台程序是提取zip文件,在解压缩zip文件时会出现一个弹出对话框。程序在计划任务上运行,这意味着将有人工干预(点击按钮)。所以我浏览了一下,看看如何删除弹出窗口。





我发现一个可以让我在注册表中创建一个子项。默认情况下,创建的子项将具有:

名称类型数据

(默认)REG_SZ(未设置值)



我需要做的是用0(零)替换数据。我该怎么做?



我正在以编程方式对注册表进行更改。如果子密钥存在,那么我不需要进入注册表并继续该过程。



请帮助我。

Hi,

Part of the console program i''m doing is extraction of a zip file, and in extracting the zip file, a popup dialog box appears. The program run on scheduled task, meaning there will be human intervation(clicking of buttons). So i so browsed to see what to do to remove the popups.


I found one thats makes me create a subkey in the registry. By default, the created subkey will have:
Name Type Data
(Default) REG_SZ (Value Not Set)

What I need to do is to replace the data with 0(zero). How can i do this ?

I''m doing the changes in registry programmatically. If the subkey exists, then i don''t need to enter the registry and continue with the process.

Please Help me.

推荐答案

这是如何: http://msdn.microsoft.com/en -us / library / 5a5t63w8.aspx [ ^ ]。



别忘了你要覆盖 {默认} 值。第二个参数应该是 null string.Empty ,它代表 {Default} ,第三 - 零。在上面引用的第一个注释部分对此进行了解释。



-SA
This is how: http://msdn.microsoft.com/en-us/library/5a5t63w8.aspx[^].

Don''t forget that you want to overwrite the {Default} value. Second parameter should be either null or string.Empty, which represents {Default}, and third — zero. This is explained in the first "Note" section referenced above.

—SA


这篇关于在运行时创建/修改注册表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆