Check if Folder is available
SPList myList = web.Lists["Pages"];
SPFolder oFolder = myList.RootFolder.SubFolders["foldername"];
SPFolder oFolder = myList.RootFolder.SubFolders["foldername"];
But instead of mentioning
if (oFolder == null)
{
Console.WriteLine("FOLDER NOT FOUND");
}
else
{
Console.WriteLine("FOLDER FOUND");
Console.ReadLine();
}
{
Console.WriteLine("FOLDER NOT FOUND");
}
else
{
Console.WriteLine("FOLDER FOUND");
Console.ReadLine();
}
Comments
Post a Comment