• SharePoint删除图片库文件


     SPSecurity.RunWithElevatedPrivileges(delegate()
                           {
                               using (SPSite site = new SPSite(SPContext.Current.Site.ID))
                               {
                                   using (SPWeb oweb = site.AllWebs[SPContext.Current.Web.ID])
                                   {
                                       oweb.AllowUnsafeUpdates = true;
                                       SPList list = oweb.Lists.TryGetList("图像"); 
                                       if (list != null)
                                       {
                                           SPFolder folder = list.RootFolder;
                                           folder.Files.Delete(urlFile);//urlFile是ServerRelativeUrl
                                       }
                                       oweb.AllowUnsafeUpdates = true;
                                   }
                               }
                           });
  • 相关阅读:
    ES6 解构
    flutter
    selenium
    selenium
    python
    selenium
    selenium
    selenium
    selenium
    selenium- SMTP发送邮件
  • 原文地址:https://www.cnblogs.com/lishidefengchen/p/5358078.html
Copyright © 2020-2023  润新知