Suresh Panta

Suresh Panta

  • 1.9k
  • 79
  • 685

check the filename existence in the list list[] before move (rename)

Mar 3 2021 2:33 PM
how can I check if the fileName has existed on the list or not before the move? 
 
NewFileName = Path.GetDirectoryName(OldFileName) + "\\" + NewFileName; 
 
System.IO.File.Move(OldFileName, NewFileName); 
thnk you in advance! 
 

Answers (5)