Tuesday, February 28, 2017

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  
         }  



SQL Get all Index create script from Database

To get all script from database as a create new index into another database you can use the following --Get all Index Script SELECT...