在Windows 7上,我可以使用以下路径从Windows访问SharePoint文件夹:
\host@port\DavWWWRoot\文件夹
使用System.IO.Directory类(.Net 4.0 SP1),我可以枚举相同路径的所有目录和文件,如下所示:
string path = @"\myhost@myport\DavWWWRoot\MyFolder“
foreach (string dir in Directory.EnumerateDirectories(path))
{
// Do something
}
foreach (string filename in Directory.EnumerateFiles(path))
{
// Do something
}上述内容在Windows上不适用-- Windows和System.IO.Directory类似乎都不适用于相同的路径。在Windows7上,Directory.Exists(path)返回true。在Windows上,它返回false。
我是否应该对Windows上的路径使用不同的语法?
发布于 2011-10-20 04:25:18
XP中对WebDAV的内置支持非常有限(如果存在的话),所以使用专门的WebDAV客户端组件是个好主意。
https://stackoverflow.com/questions/7829811
复制相似问题