【问题标题】:'The target account name is incorrect'-IOException with DirectoryInfo.GetFiles'目标帐户名称不正确' - DirectoryInfo.GetFiles 的 IOException
【发布时间】:2016-01-21 18:04:01
【问题描述】:

我正在这样做,这在以前有效:

var di = new DirectoryInfo("FolderOnSharedDrive");
var files = di.GetFiles("*");

我现在有这个例外,我能看到的唯一区别是我现在有 Windows 10。

Exception thrown: 'System.IO.IOException' in mscorlib.dll
Additional information: The target account name is incorrect.

【问题讨论】:

  • 这是一个低级 Windows 错误,ERROR_WRONG_TARGET_NAME。提供共享的机器对您使用的用户帐户不满意。这往往会在您更新操作系统时发生。

标签: c# .net ioexception directoryinfo mscorlib


【解决方案1】:

尝试使用 IP 地址而不是计算机名称。

【讨论】:

    【解决方案2】:

    通过从网络中完全注销机器来解决问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-12-25
      • 1970-01-01
      • 2021-10-30
      • 1970-01-01
      • 2010-09-17
      • 1970-01-01
      相关资源
      最近更新 更多