This should work for any number of folders even if there is only one
String myUrl = Convert.ToString(Request.Url);
String directoryPath = myURL.Substring(0, myURL.LastIndexOf("/"));
//directoryPath will be all folders and parse out the filename: folder1/folder2/folder3
String lastDirectory = directoryPath.Substring(directoryPath.LastIndexOf("/") + 1);
//lastDirectory will only be the last foldername