How to rename files in VB.NET to have a unique suffix?

后端 未结 5 1907
没有蜡笔的小新
没有蜡笔的小新 2020-12-06 20:01

I understand how to rename a file in VB.NET as I use in the code at the end of my post. However, I was wondering if it\'s possible to rename a file and if the file exists th

5条回答
  •  囚心锁ツ
    2020-12-06 20:28

    If System.IO.File.Exists("c:\test\NewName.txt") Then
       ' add +1 or loop exists with increment on the end until file doesn't exist
    End If
    

提交回复
热议问题