【发布时间】:2018-07-03 15:13:06
【问题描述】:
我是 Sharepoint 的新手,目前正在使用 Sharepoint Online。我需要在 C# 中的共享点文档库下检索文件。
我们有几个文档库网址如下:
- https://customer1.sharepoint.com/DocumentFolder/Forms/AllItems.aspx
- https://customer2.sharepoint.com/sites/站点名称/DocumentFolder/SubFolder/Forms/AllItems.aspx
如果是上面的 URL 1,我需要提取 DocumentFolder 名称,如果是 URL 2,我需要提取 DocumentFolder/SubFolder 名称
使用Sharepoint REST 服务,然后我想列出 DocumentFolder 下的文件:
http://siteurl/_api/web/GetFolderByServerRelativeUrl('/DocumentFolder')
我面临的挑战是为上述 URL 提取 DocumentFolder,因为我找不到任何 API/方法调用来提取 DocumentFolder。我可以在 url 上尝试正则表达式,但它会很有帮助,如果有正确的方法来提取 DocumentFolder/SubFolder,那将会很有帮助。
【问题讨论】:
标签: c# sharepoint-online