Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi.

 

How do I rename files that I have in a dir? I can get the pathname and filename but I don't know how to rename the file without copying the file first. Any ideas?

Posted
system.IO.File.Move("old name","new name")

 

Am I getting this right? He wants to rename a file from within his application... He uses this method? I am new, so all information helps.

Firefighters do it with a big hose...
  • *Experts*
Posted

If you pass the same directory to both parameters of the method,

then sure, the file is being renamed. Think of it as being moved to

a different place within the folder. This method can also move

files do different directories, of course, but if you pass the same

directory structure to both parameters, the method will simply

rename the file.

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...