You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
770 B
33 lines
770 B
using System; |
|
using System.Collections.Generic; |
|
//using System.IO.Ports; |
|
//using System.Runtime.InteropServices; |
|
using Microsoft.Win32; |
|
|
|
namespace UTIL |
|
{ |
|
public class Reg |
|
{ |
|
private RegistryKey rk; |
|
public Reg(RegistryKey k, string path) |
|
{ |
|
rk = k.OpenSubKey(path, true); |
|
if (rk == null) |
|
{ |
|
rk = k.CreateSubKey(path, true); |
|
} |
|
|
|
} |
|
public string ReadKey(string keyname) |
|
{ |
|
if (rk.GetValue(keyname) != null) |
|
return rk.GetValue(keyname).ToString(); |
|
else |
|
return null; |
|
} |
|
public void WriteKey(string keyname, string val) |
|
{ |
|
rk.SetValue(keyname, val); |
|
} |
|
} |
|
}
|
|
|