库下动态新增文件夹

库下动态新增文件夹

        /// <summary>
/// 在创建SP文库库下动态新增文件夹
/// </summary>
/// <param name="spList"></param>
/// <param name="_folderName"></param>
private void CreateFileDir(List spList,string _folderName)
{
ListItemCreationInformation information;
SP.ListItem folder;
information = new ListItemCreationInformation()
{
LeafName = _folderName,
UnderlyingObjectType = SP.FileSystemObjectType.Folder
};
folder = spList.AddItem(information);
folder.Update();
context.ExecuteQuery();
}
05-02 02:39