how to create dynamic folder with "jobid" name within C:\Temp\Sub_Folder
-
hi all, i need a help... need to create a dynamic sub folder to store particular job_id's excel files within the sub folder with job_id's name, here the job_id is identity column.. say for eg., JON101, JON123, etc... sqlcmdsql.Parameters.AddWithValue("@fullFileName", "C:\Bcp\" + Utilities.Jobid + ".xls") the above code is for generating excel file within common folder, now i need to create sub_folder... anyone came across this issue, pls help me to resolve :((
-
hi all, i need a help... need to create a dynamic sub folder to store particular job_id's excel files within the sub folder with job_id's name, here the job_id is identity column.. say for eg., JON101, JON123, etc... sqlcmdsql.Parameters.AddWithValue("@fullFileName", "C:\Bcp\" + Utilities.Jobid + ".xls") the above code is for generating excel file within common folder, now i need to create sub_folder... anyone came across this issue, pls help me to resolve :((
//this is code to create folder.... private string CreateFolder(string FolderName) { if ((!Directory.Exists(@"D:\ " + FolderName + ""))) { DirectoryInfo oDirectoryInfo = default(DirectoryInfo); oDirectoryInfo = Directory.CreateDirectory(@"D:\ " + FolderName + ""); } }
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
-
//this is code to create folder.... private string CreateFolder(string FolderName) { if ((!Directory.Exists(@"D:\ " + FolderName + ""))) { DirectoryInfo oDirectoryInfo = default(DirectoryInfo); oDirectoryInfo = Directory.CreateDirectory(@"D:\ " + FolderName + ""); } }
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
//to move data from one folder to another DirectoryInfo dir1= new DirectoryInfo("F:Folder1"); DirectoryInfo dir2 = new DirectoryInfo("F:Folder2"); FileInfo[] Folder1Files = dir1.GetFiles(); if(Folder1Files.Length > 0) { foreach(FileInfo aFile in Folder1Files) { if(File.Exists("F:Folder2" + aFile.Name)) { File.Delete("F:Folder2" + aFile.Name); } aFile.MoveTo("F:Folder2" + aFile.Name); } }
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
-
hi all, i need a help... need to create a dynamic sub folder to store particular job_id's excel files within the sub folder with job_id's name, here the job_id is identity column.. say for eg., JON101, JON123, etc... sqlcmdsql.Parameters.AddWithValue("@fullFileName", "C:\Bcp\" + Utilities.Jobid + ".xls") the above code is for generating excel file within common folder, now i need to create sub_folder... anyone came across this issue, pls help me to resolve :((
//Create folder in server fso = Server.CreateObject("Scripting.FileSystemObject"); fso.CreateFolder("d:\New Folder1"); //example 2 System.IO.Directory.CreateDirectory(Server.MapPath("path_name")+ "\\NewFolder1");
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]