Remove file extention.

Worf

Member
Joined
Dec 19, 2008
Messages
15
Hi.

I have found that to get part of my program to do what i need it to do with causing proplems is to remove the file extention, do what needs to be done with the files and then put the file extention back.

Now my program checks if the files are more than eight characters long, if so then reduce them down do only eight characters.
Now the problem i have is that some times i get (Name..jpg or Name.jp.jpg), so i need to remove the extentions then replace the extentions after they have been shortend.

How would this be done?


Many Thanks

Worf
 
The System.IO.Path class will do pretty much everything you are after in regard to manipulating file names.

Out of interest is there a reason why you are truncating file names to eight characters?
 
Out of interest is there a reason why you are truncating file names to eight characters?

Hi PlausiblyDamp.

Thank you for you reply.

The reason i need to truncate the file names to eight characters is that the TXTSETUP.SIF only allows filenames of eight chars.

I am writting a program that will allow you to customize Windows XP by integrating Wallpapers, Sound Schemes, Visual Styles, Registry entries ect directly into the Windows Source because at the moment you need to use $OEM$ folder to do this.

I do have another problem but i will put up another post for that.

Regards

Worf
 
Back
Top