I have to create multiple folders as e.g.
Directory.CreateDirectory("PATH\\" + _year + "filetosave.txt");
while "PATH\\"
is the full path where the folder will reside, _year
is the parameter and "filetosave.txt"
is the file which is to be saved in respective folder.
And at run time, it should create respective folders with years in the folder name containing respective files to save.
Whereas .CreateDirectory()
method only accepts string path
or string path, security access
as parameters.
- How will we create these parameterized folders?
- How can we make a check that a specified directory already exists or not?