Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. how to create dynamic folder with "jobid" name within C:\Temp\Sub_Folder

how to create dynamic folder with "jobid" name within C:\Temp\Sub_Folder

Scheduled Pinned Locked Moved .NET (Core and Framework)
helptutorialcareer
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    Uma J
    wrote on last edited by
    #1

    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 :((

    P 2 Replies Last reply
    0
    • U Uma J

      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 :((

      P Offline
      P Offline
      padmanabhan N
      wrote on last edited by
      #2

      //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[^]

      P 1 Reply Last reply
      0
      • P padmanabhan N

        //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[^]

        P Offline
        P Offline
        padmanabhan N
        wrote on last edited by
        #3

        //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[^]

        1 Reply Last reply
        0
        • U Uma J

          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 :((

          P Offline
          P Offline
          padmanabhan N
          wrote on last edited by
          #4

          //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[^]

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups