public CreateFolder ( string name ) : bool | ||
name | string | Nombre de la Carpeta a crear ydonde va a estar la carpet: Example /// "/Document Library/Folder1" ////Creates a folder named “Folder11” under “Folder1” in “Document Library” in a sub site |
return | bool |
public bool CreateFolder(string name)
{
try
{
var list = Web.Lists.TryGetList(Name);
if (list == null)
{
return false;
}
var folderCollection = list.RootFolder.SubFolders;
folderCollection.Add(name);
return true;
}
catch (Exception exception)
{
Logger.Error(string.Concat("Error Añadir Folder", exception.Message));
return false;
}
}