Re: changing a filename in C#

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: J. Marshall Latham (marshall_at_networkip.net)
Date: 03/06/04


Date: Sat, 6 Mar 2004 09:44:36 -0600

Thanks. I will see if I can get this to work
"Justin Rogers" <Justin@games4dotnet.com> wrote in message
news:ufRc5a0AEHA.916@tk2msftngp13.phx.gbl...
> FileInfo original = new FileInfo(pathToFile);
> if ( original.Exists ) {
> // If the destination already exists then this won't copy.
> // This is to protect other files when performing the operation.
> original.CopyTo(Path.ChangeExtension(original.FullName, ".txt"),
false);
> }
>
>
>
> --
> Justin Rogers
> DigiTec Web Consultants, LLC.
> Blog: http://weblogs.asp.net/justin_rogers