参考资料:
https://blog.csdn.net/yal179/article/details/40402435
https://www.cnblogs.com/boby-/p/4724255.html
******************************************************************
界面:
代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.Win32;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btn1_Click(object sender, EventArgs e) //打开或新建并读取注册表项值
{
try
{
//对应HKEY_CURRENT_USER基项分支
RegistryKey cu1 = Registry.CurrentUser;