美文网首页
设置注册表子项的(默认)值

设置注册表子项的(默认)值

作者: jingkanghou | 来源:发表于2018-04-17 10:35 被阅读0次

注册表子项有一个(默认)键值,如何设置和获取官网的答案如下:

Note
A registry key can have one value that is not associated with any name. When this unnamed value is displayed in the registry editor, the string "(Default)" appears instead of a name. To set this unnamed value, specify either null or the empty string ("") for name.

示例

RegistryKey _appRegHandle;
_appRegHandle = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\WOW6432Node\MyApp", true);

// 创建子项
_appRegHandle.CreateSubKey("testsub");
// 打开子项
RegistryKey testKey = _appRegHandle.OpenSubKey("testsub",true);
// 设置(默认)值
testKey.SetValue("", "abc");
// 获取(默认)值
string testValue = testkey.GetValue("").ToString();

testkey.Close();
_appRegHandle.Close();

相关文章

  • 设置注册表子项的(默认)值

    注册表子项有一个(默认)键值,如何设置和获取官网的答案如下: NoteA registry key can hav...

  • Flex之flex-basis、flex-shrink、flex

    flex-basis 设置子项的占用空间。如果设置了值,则子项占用的空间为设置的值;如果没设置或者为auto,则子...

  • se6函数扩展

    es6函数可以设置默认值,如下: 函数设置默认值时有这么几个限制: 参数设置默认值时,不能有重复的值,如: 设置了...

  • flex-basis,flex-grow,flex-shrink

    flex-basis 设置子项占用空间(默认:auto),如果没有设置就使用width/height,否则由内容撑...

  • PT5的默认值运算符

    1、模板变量的默认值 自定义变量设置默认值; 系统变量设置默认值; 变量的函数与默认值可以同时使用。 index....

  • 正则1的小结

    默认:没有子项的时候 有子项:

  • 函数参数默认值

    基础用法 使用默认值语法设置函数参数的默认值。

  • mysql datetime类型设置默认值

    datetime在默认值处,设置默认值:CURRENT_TIMESTAMP

  • 44-表相关操作

    一、约束条件 not null标识该字段不能为空和default设置默认值没设置默认值时插入空数据会报错:设置默认...

  • vue-resource 配置

    使用全局配置设置默认值。 在 Vue 组件选项中设置默认值。 Webpack/Browserify 在 packa...

网友评论

      本文标题:设置注册表子项的(默认)值

      本文链接:https://www.haomeiwen.com/subject/jxdukftx.html