dc

dc

  • NA
  • 663
  • 0

C# create directory path dynamically

Oct 25 2012 12:13 AM
In a C# 2008 console application, I am placing excel and pdf files in a directory path dynamically. The directory path is created dynamically daily ok. But once more subdirectory levels need to be created for the same day, the lower level directory paths are not created and the corresponding documents are not placed into the lower level directory.


Basically here is the file structure:

1. The first part of the directory is obtained frpm the app.config file where the value is:

C:\allcustomers.

2. The second level of the directory path is in a mm_dd_yyyy format. This value is obtained from the current run date.

To this point, the directory stucture looks like the following:

C:\allcustomers\10_23_2012.

3. The lowest level of the directory path is the customer invoice number that looks like inv10232012675.

Thus the directory path looks like:

C:\allcustomers\10_23_2012\inv10232012675.

Thus basically when I need to add a second level directory path that looks like the following:

C:\allcustomers\10_23_2012\inv10232012999, the level is not created for the rest of the day.

Thus can you tell me how I can fix my problem?

Answers (2)