实现效果:

  

知识运用:

  通过注册表中HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\子键下的LegalNoticeCaptionLegalNoticeText项的值

来实现

RegistryKey类的CreateSubKey    SetValue方法

  public RegistryKey CreateSubKey (string  subkey)  //创建一个或打开一个子项进行写访问

    //使用指定的注册表数据类型设置注册表中的名称/值对的值

      //name:存储的值名称  value:存储的数据  valueKind:存储是使用的注册表数据类型

  public void SetValue  (string name ,Object value ,RegistryValueKind  valueKind)

补:使用RegistryKey和Registry类时  引用  Microsoft. Win32

实现代码:

        private void button1_Click(object sender, EventArgs e)
{
RegistryKey rkey = Registry.LocalMachine; //获取注册表中的LocalMachine节点
RegistryKey rinfo = rkey.CreateSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"); //创建注册表项
rinfo.SetValue("LegalNoticeCaption",textBox1.Text,RegistryValueKind.String); //设置键
rinfo.SetValue("LegalNoticeText",textBox2.Text,RegistryValueKind.String); //设置值
MessageBox.Show("设置成功!请重新启动","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
}

  

最新文章

  1. python gutter area / 设置断点、行号右边代码左边的空白栏
  2. clang编译mysql(Ubuntu10 64位)
  3. Android中ListView 控件与 Adapter 适配器如何使用?
  4. 数据结构 《5》----二叉搜索树 ( Binary Search Tree )
  5. Project Euler 108:Diophantine reciprocals I 丢番图倒数I
  6. 时间处理总结(一).net
  7. Apple-Watch开发2 APPIcon设置
  8. list、dict、tuple的一些小操作总结
  9. Intel为什么做不好手机CPU?
  10. C++类对象大小的计算
  11. php SESSION入库的实现
  12. Map集合转成json数据
  13. socket的阻塞与非阻塞,同步与异步
  14. flask使用基础
  15. Houdini技术体系大纲
  16. private static final long serialVersionUID = 1L这句话到底什么意思?
  17. JVM(3)对象A和B循环引用,最后会不会不被GC回收?-------关于Java的GC机制
  18. url后面添加参数,注意&?的添加方式
  19. iOS 开发笔记-Storyboard
  20. 机器学习--boosting家族之Adaboost算法

热门文章

  1. [Django笔记] uwsgi + nginx 配置
  2. 【转】processOnServer
  3. 没有找零 状压dp
  4. 使用mount命令挂载CDROM
  5. 暴风魔镜SDK:MojingSDK For Unity V1.3.5112 (R).zip
  6. ligerUI弹出框
  7. 测试之美 Part 1
  8. input和button不同高 和 rem
  9. JS——通过标签获取元素、循环语句、数组去重
  10. 让最新的 Android Q Beta 3 强制重启的 Project Mainline,到底是什么?