如何将类型“object”显示转换为“Microsoft.Win32.RegistryKey”(在线等!)
如何将类型“object”显示转换为“Microsoft.Win32.RegistryKey”
各位高手帮忙指点指点~
我刚学面向对象
今天写了个东西,可是有个问题没有能解决
我就是想实现对注册表的一些小操作,
源代码这样的:
namespace Regedit
{
public class Regedit
{
public readonly object path;
public Regedit(object newPath)
{
path = newPath;
}
public string[] ReadRegedit()
{
RegistryKey RegeditPath = path;
return RegeditPath.GetValueNames();
}
public void DeletRegedit(string value)
{
RegistryKey RegeditPath = path;
try
{
RegeditPath.DeleteValue(value, true);
}
catch
{
Console.WriteLine( "您要删除的信息不存在 ");
}
}
public void UpRegedit(string value)
{
RegistryKey RegeditPath = path;
foreach (string site in RegeditPath.GetValueNames())
{
try
{
if (site == value)
{