单击按钮导出注册表文件(* .reg) [英] One click button export registry file (*.reg)

查看:239
本文介绍了单击按钮导出注册表文件(* .reg)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

点击按钮导出.reg文件

来自:ComputerName \HKEY_CURRENT_USER \Software \VB和VBA程序设置\ Test1



到应用程序补丁,或者从我的电脑到另一个地方....



我尝试了什么:



click button to export .reg file
from: ComputerName\HKEY_CURRENT_USER\Software\VB and VBA Program Settings\Test1

to application patch, or another place from my computer....

What I have tried:

I searched the internet but I did not find anything

推荐答案

这是c#等价物,所以你可以根据需要转换为vb.net。网上有很多其他的例子。



Here is the c# equivalent, so you could convert to vb.net should you desire.There are plenty other examples on the net.

private static void Export(string exportPath, string registryPath)
{ 
    string path = "\""+ exportPath + "\"";
    string key = "\""+ registryPath + "\"";
    Process proc = new Process();

    try
    {
        proc.StartInfo.FileName = "regedit.exe";
        proc.StartInfo.UseShellExecute = false;

        proc = Process.Start("regedit.exe", "/e " + path + " "+ key);
        proc.WaitForExit();
    }
    catch (Exception)
    {
        proc.Dispose();
    }
}





来源:命令行 - 如何在c#中导出注册表 - Stack Overflow [ ^ ]


这篇关于单击按钮导出注册表文件(* .reg)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆