private void button1_Click(object sender, EventArgs e)
{
RegistryKey rkey = Registry.LocalMachine;//获取注册表中的LocalMachine节点
RegistryKey rkeyInfo = rkey.CreateSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon");//创建注册表项
rkeyInfo.SetValue("LegalNoticeCaption", textBox1.Text, RegistryValueKind.String);//设置键
rkeyInfo.SetValue("LegalNoticeText", textBox2.Text, RegistryValueKind.String);//设置值
MessageBox.Show("已完成设置,请重新启动计算机!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
亲爱的:若该文章解决了您的问题,可否收藏+评论+分享呢?
文章评论 本文章有个评论