简单的读写操作 Dim loca As RegistryKey = Registry.LocalMachine Dim run As RegistryKey = loca.CreateSubKey("SOFTWARE\NetLogin") run.SetValue("UserName", txtUsername.Text.Trim) run.SetValue("password", txtPwd.Text.Trim)Dim name As String = "" Dim password As String = "" Dim loca As RegistryKey = Registry.LocalMachine Dim run As RegistryKey = loca.CreateSubKey("SOFTWARE\NetLogin") name = run.GetValue("UserName") password = run.GetValue("password")
RegistryKey rk= Registry.CurrentUser;
RegistryKey subkey = rk.OpenSubKey(keypath, true);
操作 subkey 就可以了 有get 和set
http://www.pconline.com.cn/pcedu/empolder/net/0412/508782.html自己Google下
信息很多
http://www.cnblogs.com/hanfeng/archive/2007/09/09/112246.html
Dim run As RegistryKey = loca.CreateSubKey("SOFTWARE\NetLogin")
run.SetValue("UserName", txtUsername.Text.Trim)
run.SetValue("password", txtPwd.Text.Trim)Dim name As String = ""
Dim password As String = ""
Dim loca As RegistryKey = Registry.LocalMachine
Dim run As RegistryKey = loca.CreateSubKey("SOFTWARE\NetLogin")
name = run.GetValue("UserName")
password = run.GetValue("password")
private static RegistryKey rk = Registry.LocalMachine; //注册表
private static RegistryKey rsk;private void RedKey()
{
rk = rk.CreateSubKey("SOFTWARE");
rsk = rk.CreateSubKey("ABC");
string key1 = rsk.GetValue("Key1").ToString();
}private void WriteKey()
{
rk = rk.CreateSubKey("SOFTWARE");
rsk = rk.CreateSubKey("ABC");
rsk.SetValue("Key1", "kkkeeeyyy1");
}