首页 > 代码库 > Sharepoint 根据文件相对路径获取、操作SPFolder
Sharepoint 根据文件相对路径获取、操作SPFolder
public AjaxResult LoadDocInfo(HttpContext httpContext) { var result = new ArrayList(); try { var orgId = httpContext.Request["orgId"]; var curFolder = DataFactory.GetOrganizationAppService().FindOrganizationsById(orgId); var curFolderPath = GetFolderPath(curFolder);//中国一维金融集团/弘达资本集团/上海中锋保理/业务部 var curSite = SPContext.Current.Site; var curWeb = SPContext.Current.Web; SPSecurity.RunWithElevatedPrivileges(delegate { using (var site = new SPSite(curSite.ID)) { using (var web = site.OpenWeb(curWeb.ID)) { SPFolder folder = web.GetFolder("/" + web.Name + "/Shared Documents/" + curFolderPath); if (folder != null) { foreach (SPFile sf in folder.Files) { result.Add(new { id = sf.UniqueId, name = sf.Name, length = sf.Length }); } } } } }); return new AjaxResult(true, result); } catch (Exception ex) { LogHelper.WriteLog(LogArea.Service, LogLevelType.ERROR, "OrganizationService-LoadDocInfo", ex); return new AjaxResult(false, ex.Message); } }
Sharepoint 根据文件相对路径获取、操作SPFolder
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。