0
How can I list only the name of a folder that is inside a root folder?
Example:
Pasta raiz C:/Downloads
SubPastas: Teste/ Teste 2
In my DLL I can list the folders but with its full path, I would just like to list the name of the subfolders:
In case only Teste
and Teste 2
Follows code:
private void carregarFolders()
{
try
{
string caminho = @"C:/Downloads";
ddlFolders.DataSource = Directory.GetDirectories(caminho);
ddlFolders.DataValueField = "";
ddlFolders.DataTextField = "";
ddlFolders.DataBind();
ddlFolders.Items.Insert(0, new ListItem(string.Empty, string.Empty));
}
catch (Exception ex)
{
throw ex;
}
}