【问题标题】:How enumerate folders and files in a SharePoint folder on Windows XP versus Windows 7如何在 Windows XP 与 Windows 7 上枚举 SharePoint 文件夹中的文件夹和文件
【发布时间】:2011-10-20 00:28:53
【问题描述】:

在 Windows 7 上,我可以使用以下路径从 Windows 资源管理器访问 SharePoint 文件夹:

\\host@port\DavWWWRoot\文件夹\

使用 System.IO.Directory 类 (.Net 4.0 SP1),我可以枚举同一路径的所有目录和文件,如下所示:

字符串路径 = @"\\myhost@myport\DavWWWRoot\MyFolder"

foreach (string dir in Directory.EnumerateDirectories(path))
{
    // Do something
}

foreach (string filename in Directory.EnumerateFiles(path))
{
    // Do something
}

以上内容在 Windows XP 上对我不起作用 - Windows 资源管理器和 System.IO.Directory 类似乎不适用于同一路径。在 Windows 7 上 Directory.Exists(path) 返回 true。在 Windows XP 上,它返回 false

我应该对 Windows XP 上的路径使用不同的语法吗?

【问题讨论】:

    标签: c# sharepoint windows-7 io webdav


    【解决方案1】:

    XP 中对 WebDAV 的内置支持非常有限(如果有的话),因此最好使用专门的 WebDAV 客户端组件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-02-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-24
      相关资源
      最近更新 更多