In a C# 2010 application I need to setup different directory levels in a file structure and place various files like pdf, word, excel, and tiff files in the various folders that are created.The full directory structure will look like the following:
D://totalinventory/department_codes/date formatted like mm-yyyy/quanity-on-hand/customer number.
Can you tell me how to write this code?
C# writing files
5 Answers
Know the answer? Post it. Somebody with the same question will find it here.

FroglegRank #1,020 · 1.9K reputationPosted Oct 27, 2012, 12:03 PM EDT
string str = DateTime.Now.ToShortDateString();
string _theDate = str.Replace("/","_");
Directory.CreateDirectory(@"D:\totalinventory\department_codes\" + _theDate + @"\quanity_on_hand\customer number");
Sie Ste196 reputationPosted Oct 27, 2012, 8:15 PM EDT
FroglegRank #1,020 · 1.9K reputationPosted Oct 28, 2012, 12:23 AM EDT
Sie Ste196 reputationPosted Oct 28, 2012, 4:50 PM EDT
FroglegRank #1,020 · 1.9K reputationPosted Oct 28, 2012, 5:09 PM EDT