How to Generate unique file names in C#

后端 未结 19 2531
生来不讨喜
生来不讨喜 2020-12-02 05:43

I have implemented an algorithm that will generate unique names for files that will save on hard drive. I\'m appending DateTime: Hours,Minutes,Second an

19条回答
  •  广开言路
    2020-12-02 06:18

    1. Create your timestamped filename following your normal process
    2. Check to see if filename exists
    3. False - save file
    4. True - Append additional character to file, perhaps a counter
    5. Go to step 2

提交回复
热议问题