You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

C#远程PC文件夹无法在Windows资源管理器打开问题求助

问题:无法通过身份模拟在Windows资源管理器中打开远程文件夹

我需要在Windows文件资源管理器中打开远程PC的文件夹,为此编写了以下C#方法:

private void openComponentFolder_Click(object sender, RoutedEventArgs e)
{
    #region Connexion to the bench
    ImpersonatedUser iuImpersonatedUser = new ImpersonatedUser(BenchInfos.Current.UserName, "user", BenchInfos.Current.PcPassword);

    iuImpersonatedUser.LogOn();
    #endregion

    Component component = (sender as MenuItem).DataContext as Component;

    if (component != null)
        if (Directory.Exists(component.Path))
            Process.Start(component.Path);

    #region Disconnexion
    iuImpersonatedUser.LogOut();
    iuImpersonatedUser.Dispose();
    #endregion
}

点击WPF TreeView中的某个Component时,程序会通过远程PC的用户名BenchInfos.Current.UserName、域"user"和密码BenchInfos.Current.PcPassword进行身份模拟登录。如果component.Path对应的路径存在,就尝试在Windows文件资源管理器中打开该文件夹,最后注销远程连接。

但运行该方法时,会弹出“拒绝访问(Accès refusé)”的错误提示(路径确实存在),而在其他方法中,我能够正常读取component.Path文件夹下的文件。

请问:为什么无法在Windows资源管理器中打开该文件夹?该如何解决这个问题?

内容的提问来源于stack exchange,提问作者Remi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.13 18:20:32