Hi I have to get files from a specified path in the directory. This is the method I wrote but I didn't get the files from the subfolders.
Private void getfiles(){
Directoryinfo info = new Directoryinfo(configurationmanager.appsettings["Targetroot"].tostring ());
if (info.exists){
Gvfiles.datasource = info.GetFiles();
Gvfiles.databind();
}
}
You will want to include the SearchOption.AllDirectories.
Example:
info.GetFiles("*", SearchOption.AllDirectories);
Reference: http://msdn.microsoft.com/en-us/library/ms143327(v=vs.80).aspx
And: http://msdn.microsoft.com/en-us/library/ms143448(v=vs.80).aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With