Skip to content

Any idea

nizam syed

Asked Feb 22, 2006, 8:56 PM EST2 answers
Share
LinkedInX

how to create folders dynamically. the folder should differentiate each time.for example the folder should have foldername with its date and time.ex:new folder 24/2/06 10:45 am.
this is because when i download the file next time the time is different with same name and date.

plz can u give me some idea. u can mail to [email protected]


Thanks in advance,
nizam.

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    There is a function CreateDirectory....

    U can use that....
    0
  • Anwar Buchoo
    0


    Use the following code:

    System.IO.Directory.CreateDirectory(this.GetPath());

    private void GetPath()
    {
      string dateTime = DateTime.Now.ToString();
      dateTime = dateTime.Replace("/", ""); // in date
      dateTime = dateTime.Replace(":", ""); // in time
      dateTime = dateTime.Replace(" ", "_"); // date/time separator
     
      return String.Concat("$MyDir\MyFolderName", dateTime);
    }


    Rgds.

    0