Rename a file DOT.NET V2

  • Thread starter Thread starter Lloyd Sheen
  • Start date Start date
L

Lloyd Sheen

Seems to me there should be a simple method available in the framework to
rename a file, but I cannot find such a thing. This has to be something
that is done all the time so I am assuming I just don't see the function.

Help, thanks
Lloyd Sheen
 
Terry said:
Try:

File.Move(oldfilename,newfilename)

You could also try the new methods in the "My" object:

\\\
My.Computer.FileSystem.RenameFile(file, newName)
///
 
Thanks guys. I only want to use non VB libs so that I can convert to C#
without too many problems so I will use the File.Move. That is not too
intuitive then is it.
 
Oenone said:
You could also try the new methods in the "My" object:

\\\
My.Computer.FileSystem.RenameFile(file, newName)
///

.... or 'Microsoft.VisualBasic.FileSystem.Rename'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top