changing a filename in C#

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


Date: Fri, 5 Mar 2004 23:58:57 -0600

I can't seem to find any resources to help me change a filename using C#. I
see a Path.ChangeExtension, but it only takes the full path as a string and
changes that string. It doesn't actually change the file (at least not from
what I have seen). I tried moving the file into the same directory with a
different name and totally lost my file. I am about to try moving it to
another directory and then moving it back with the new name. All I really
want to do is change the extension on the file from .tmp to .txt. Can
someone tell me how I can use C# code to change the name of a file. I
apologize if this is too elementary for this news group.

Thanks for your help,

JML



Relevant Pages

  • Re: changing a filename in C#
    ... > I can't seem to find any resources to help me change a filename using C#. ... > changes that string. ... I am about to try moving it to ... > apologize if this is too elementary for this news group. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Book recommendatiom, please
    ... I've recently started moving from "classic" asp to asp.net myself. ... resources that helped me most were aspnet.4guysfromrolla.com (especially the ... general type articles about what asp.net is how it fits in etc) there's also ...
    (microsoft.public.frontpage.programming)
  • Re: IP address blocks
    ... the string "vc" which I took to be either Victoria ... interface, of course, which is what they claim their ISP does. ... I'm sure their lips are moving as they read too. ...
    (rec.crafts.glass)
  • Re: Luthier question: Intonating via thinning braces
    ... Top motion can effect the pitch of specific partials of certain notes. ... The same thing happens when the string is pushing on the top: ... position, and moving downward, and pulling 'down' when it's below. ...
    (rec.music.classical.guitar)
  • Re: Delimited String to Array
    ... The guy said that he was moving from delphi to C# and was working with ... string. ... Perhaps he could also glean additional information from the errata ...
    (microsoft.public.dotnet.languages.csharp)

Loading