Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/277.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在c#中,如何使用特定用户访问远程注册表?_C#_.net_Windows Forms Designer_Remote Access_Remote Registry - Fatal编程技术网

在c#中,如何使用特定用户访问远程注册表?

在c#中,如何使用特定用户访问远程注册表?,c#,.net,windows-forms-designer,remote-access,remote-registry,C#,.net,Windows Forms Designer,Remote Access,Remote Registry,以下是我用于访问远程注册表的代码: private void getAllOdbc(string pc) { RegistryKey regKey; regKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.CurrentUser, pc.ToString(), RegistryView.Registry64).OpenSubKey("SOFTWARE\\ODBC\\ODBC.INI\\ODBC Da

以下是我用于访问远程注册表的代码:

    private void getAllOdbc(string pc)
    {
        RegistryKey regKey;

        regKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.CurrentUser, pc.ToString(), RegistryView.Registry64).OpenSubKey("SOFTWARE\\ODBC\\ODBC.INI\\ODBC Data Sources");
    }
我想使用具有远程计算机权限的特定用户访问远程注册表

当我从自己的计算机启动此windows窗体应用程序时,它会工作,因为我已使用此在远程计算机上具有权限的特定用户登录,但我必须在未使用此特定用户登录的其他计算机上使用此应用程序

因此,我想在我的代码中插入一些东西,告诉我的应用程序使用此特定用户访问远程注册表,就像这样,任何人都可以使用我的应用程序,而无需使用此特定用户登录


我已经允许在远程计算机上使用远程注册表服务。

在远程主机上打开自己的注册表数据之前,您可能必须拥有自己的线程

有一种可能的解决方案不使用
OpenRemoteBaseKey
。希望能有帮助