Suresh Panta

Suresh Panta

  • NA
  • 109
  • 3k

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)