C# create folder on runtime



You can try this code: this will read data from app.config for folder path. if the the path is not found then it it will create folder.


 string curDirectory = ConfigurationManager.AppSettings["AppOutPath"];  
 if (Directory.Exists(curDirectory + @"\Uploads"))  
         {  
           // Do something  
         }  
         else  
         {  
           Directory.CreateDirectory(curDirectory + @"\Uploads");  
           // Do something  
         }  



Popular posts from this blog

WPF Crystal Report Viewer Using SAP

mvc razor textboxfor change event change another textboxfor value

ASP.NET MVC razor SAP Crystal report