0
Create folder in another folder
Hi i want create app that create folder from file name and the move file to folder that has same name I use IEnumerable to search file with mkv extension and the use foreach to move every file to their folder but my code can't create folder ( sorry for my bad English ) use Directory.CreateDirectory (path.getfilenamewithoutextension(iso //iso came from foreach for separate file ))
1 Antwort
+ 1
Can you create a directory in that folder using explorer ?
Do you have writing or modifying rigths ?
What is the value of path.getfilenamewithoutextension
Can you print this ?
// GetFileNameWithoutExtension('C:\mydir\myfile.ext') returns 'myfile'
It could be that you need to add the root-path (Like "c:\temp" or something more usefull) to the result of "getfilenamewithoutextension"
https://docs.microsoft.com/en-us/dotnet/api/system.io.path.getfilenamewithoutextension?view=netframework-4.8