kamagra how much to take

Determine If There Are Files And Folders In SharePoint Document Library

This example shows you how to determine whether there are files or folders in a SharePoint asset. This is an asset existence method and can be used to prevent the overriding of other content.

  1. public static bool FolderContainsAssets(SPFolder folder, string fileName)
  2. {
  3.         foreach (SPFile file in folder.Files)
  4.         {
  5.                 if (string.Compare(fileName, file1.Name, true) == 0)
  6.                 {
  7.                         return true;
  8.                 }
  9.         }
  10.         return false;
  11. }
  12.  
  13. public static bool FolderContainsOtherFolders(SPFolder folder, string folderName)
  14. {
  15.         foreach (SPFolder folder in folder.SubFolders)
  16.         {
  17.                 if (string.Compare(folderName, folder1.Name, true) == 0)
  18.                 {
  19.                         return true;
  20.                 }
  21.         }
  22.         return false;
  23. }
Share

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>