CreateFolder

by ssi 17. December 2015 10:54
public class clsFolders
   {
       public void CreateFolder(string sFolder)
       {
           try
           {
               // Determine whether the directory exists.
               if (Directory.Exists(sFolder))
               {
                   Console.WriteLine(string.Format("Path: {0} exists already.", sFolder ));
                   return;
               }
 
               // Try to create the directory.
               DirectoryInfo di = Directory.CreateDirectory(sFolder);
               Console.WriteLine("The directory was created successfully at {0}."Directory.GetCreationTime(sFolder));
 
               //// Delete the directory.
               //di.Delete();
               //Console.WriteLine("The directory was deleted successfully.");
           }
           catch (Exception e)
           {
               Console.WriteLine("The process failed: {0}", e.ToString());
           }
           finally { }
 
       }
 
   }

Tags: ,

CSharp

Calendar

<<  May 2024  >>
MoTuWeThFrSaSu
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

View posts in large calendar

RecentComments

None

Development Team @ Shelbysys

We develop custom database applications for our clients. Our development tool of choice is MS Visual Studio. 

Quotations

""All glory is fleeting.""
General George S. Patton, Jr