Mohan D

Mohan D

  • NA
  • 7
  • 4.5k

Rename file extensions in a unknown directory using c#

Oct 16 2014 6:12 AM

I'm writing a code in C# and this is what i want to do:

  I want to change the extension of a file from ".txt" to ".jpg" . Bu this "txt" can be in any directory (so its a unknown directory). This it he path "C:\Users\username\Desktop\Convert" . So inside the convert folder there will be many other folders inside which there will be a ".txt" file (only one "txt" file will exist.). So the code should automatically change the extension of ".txt" file to ".jpg" . Please guide me

Answers (2)