Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2008

Tip: Looking for answers? Try searching our database.

Rename and Replace file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shapper - 13 Feb 2008 23:20 GMT
Hello,

I am moving  file from a folder A to folder B using:

System.IO.File.Move(path, newpath)

I am not sure if this is the best way to do this but I also need to:

1. Rename the file before coping it (I want to keep the extension. I
just want to rename the filename)

2. If the file already exists in the new path I want it to be
replaced.

How can I do this?

Thanks,

Miguel
Zeeshan Haider - 13 Feb 2008 23:48 GMT
You can use the FileInfo.MoveTo() method. This method moves a specified file
to a new location, providing the option to specify a new file name.

> Hello,
>
[quoted text clipped - 15 lines]
>
> Miguel

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.