I have many file types: pdf, tiff, jpeg, bmp. etc. My question is how can I change file extension? I tried this:
my file= c:/my documents/my images/cars/a.jp
try this.
filename = Path.ChangeExtension(".blah")
in you Case:
myfile= c:/my documents/my images/cars/a.jpg;
string extension = Path.GetExtension(myffile);
filename = Path.ChangeExtension(myfile,".blah")
You should look this post too:
http://msdn.microsoft.com/en-us/library/system.io.path.changeextension.aspx