http://www.cnblogs.com/jinweida/archive/2008/06/27/1230919.html
1/// <summary>
2 /// 读取注册表值
3 /// </summary>
4 /// <param name="strName"></param>
5 /// <returns></returns>
6 public static string GetRegEditData(string strName)
7 {
8 try
9 {
10 string registData;
11 RegistryKey hkml = Registry.LocalMachine; CodeCodeCode
12 RegistryKey software = hkml.OpenSubKey("SOFTWARE",true);
13 RegistryKey aimdir = software.OpenSubKey("username",true);
14 registData = aimdir.GetValue(strName).ToString();
15 return MD5Decrypt(registData);
16 }
17 catch(Exception ex)
18 {
19 Log.WriteDataBase(DateTime.Now,"3",FrmMain.userName,ex.Message,"主机名:"+System.Net.Dns.GetHostName()+";IP地址:"+FrmMain.addressList[0]);
20 return "";
21 }
22
1/// <summary>
2 /// 读取注册表值
3 /// </summary>
4 /// <param name="strName"></param>
5 /// <returns></returns>
6 public static string GetRegEditData(string strName)
7 {
8 try
9 {
10 string registData;
11 RegistryKey hkml = Registry.LocalMachine; CodeCodeCode
12 RegistryKey software = hkml.OpenSubKey("SOFTWARE",true);
13 RegistryKey aimdir = software.OpenSubKey("username",true);
14 registData = aimdir.GetValue(strName).ToString();
15 return MD5Decrypt(registData);
16 }
17 catch(Exception ex)
18 {
19 Log.WriteDataBase(DateTime.Now,"3",FrmMain.userName,ex.Message,"主机名:"+System.Net.Dns.GetHostName()+";IP地址:"+FrmMain.addressList[0]);
20 return "";
21 }
22