In a C# 2008 desktop application, I want to be able to check for a directory folder existing in a specified location. The directory path will look like C:\\main_folder\mm_yyyy. The mm_yyyy stands for the month and year.
Thus can you should be code on how to check if a folder actually exists?
I am going to write a C# 2010 application as a console application to start with. Eventually I will change the application to compile as a windows application so I do not get the dos pop windows. When this application goes into production, it will be executed by a windows scheduler. My question is the best way to pass parameters to this application.
Thus can you show me the following;
1. Code on how to accept values from paramters?
2. When the application runs as an executable, can you show me in code how to pass the values to this executable?
C# using parameters
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Hemant SrivastavaRank #581 · 4.2K reputationPosted Jan 23, 2013, 5:24 AM EST
if (!Directory.Exists(@"C:\main_folder\mm_yyyy"))
{
Directory.CreateDirectory(@"C:\main_folder\mm_yyyy");
}
For second part, I need some clarification:
When your application will go in production, will it be a Windows Service.. Right?