gpt4 book ai didi

时间:2019-03-17 标签:c#opennetcfRegistryHelper.SaveHiveBasedKey

转载 作者:行者123 更新时间:2023-11-30 17:36:30 26 4
gpt4 key购买 nike

我正在尝试找出从 Windows Mobile 6.1 设备备份整个注册表的最佳方法。我发现 OPENNETCFRegistryHelper 类应该会保存基于配置单元的 key ?

有人可以帮我先弄清楚这是否是最好的方法吗?

下面是我尝试使用的代码,但不断收到错误“无法生成注册表文件”

private void button1_Click(object sender, EventArgs e)
{
RegistryKey Key = Registry.LocalMachine.OpenSubKey(@"System\StorageManager\Profiles\SDMMC");
string outputkey = @"\Storage Card\key.reg";

SaveHiveBasedKey(Key, outputkey);
}


public static void SaveHiveBasedKey(Microsoft.Win32.RegistryKey keyToSave, string destinationPath)
{
RegistryHelper.SaveHiveBasedKey(keyToSave, destinationPath);
}

异常详细信息:

System.ComponentModel.Win32Exception was unhandled
Message="Unable to generate registry file"
ErrorCode=-2147467259
NativeErrorCode=80
StackTrace:
at OpenNETCF.Win32.RegistryHelper.SaveHiveBasedKey()
at mc9090clone.Form1.SaveHiveBasedKey()
at mc9090clone.Form1.button1_Click()
at System.Windows.Forms.Control.OnClick()
at System.Windows.Forms.Button.OnClick()
at System.Windows.Forms.ButtonBase.WnProc()
at System.Windows.Forms.Control._InternalWnProc()
at Microsoft.AGL.Forms.EVL.EnterMainLoop()
at System.Windows.Forms.Application.Run()
at mc9090clone.Program.Main()
InnerException:

最佳答案

显然 Windows Mobile 使用基于 Ram 的注册表。

 private void button1_Click(object sender, EventArgs e)
{

string outputkey = @"\key.dat";

//save registry to dat file
SaveRamBasedRegistry(outputkey);
//Restore registry file
RestoreRamBasedRegistry(outputkey);
}



public static void SaveRamBasedRegistry(string destinationPath)
{
RegistryHelper.SaveRamBasedRegistry(destinationPath);
}

public static void RestoreRamBasedRegistry(string destinationPath)
{
RegistryHelper.RestoreRamBasedRegistry(destinationPath);
}

关于时间:2019-03-17 标签:c#opennetcfRegistryHelper.SaveHiveBasedKey,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22660509/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com