how to change filetype?

  • Thread starter Thread starter lizhx
  • Start date Start date
L

lizhx

i have a file "a.mp3"
but i want wo change it to "a.asf"(not in convert,only to change the file
header and extent)

how to?

thanks
 
i have a file "a.mp3"
but i want wo change it to "a.asf"(not in convert,only to change the file
header and extent)

how to?

thanks

To change file extensions this works well

string newFilename = openFileDialog1.FileName;
newFilename = newFilename.Substring(0, filename.LastIndexOf(@".")) +
".asf";
File.Move(openFileDialog1.FileName, newFilename);
 
For some reason I thought he was just trying to change the filename as a
string...it's early here :) Combining with Arne's code, we get:

string newFilename = openFileDialog1.FileName;
File.Move( openFileDialog1.FileName,
Path.ChangeExtension(openFileDialog1.FileName, ".asf") );

ShaneB
 
Back
Top