Help with renaming in xml file using vb.net

Hi,

How do you rename an xml file in the applications's folder using vb.net?

Thanks,
Victor
vcharlesAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jacques Bourgeois (James Burger)PresidentCommented:
System.IO.File.Copy("OriginalName", "NewName")
            System.IO.File.Delete("OriginalName")
0
Wayne Taylor (webtubbs)Commented:
You can also use File.Move.
0
Fernando SotoRetiredCommented:
Use the My.Computer.FileSystem.RenameFile Method. See documentation for an example at the bottom of the page.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

Jacques Bourgeois (James Burger)PresidentCommented:
Personally, I never recommend My.Computer. This is only a shortcut provided for amateur VB programmers, to facilitate the move from VB classic to VB.NET.

Although it is an easy way out for the most common commands, it is a lot more limited than directly using the framework classes. For instance, the framework offers 5 classes to deal with files, directories and drives. My.Computer.FileSystem combines features from these 5 classes, but has less methods than each of the System.IO classes individually. The System.IO classes are thus a lot more powerful.

Also, My does not exist in other languages, it is a VB only feature. Taking the habit of using the "real" .NET classes instead of the wrapper that My will make it easier to eventually move to another language, because System.IO is available in every .NET language, while My exists only in VB.
0
vcharlesAuthor Commented:
Hi,
Thank you forr all the comments.
Victor
0
Fernando SotoRetiredCommented:
Please close the question.

Thanks
0
vcharlesAuthor Commented:
Thank You.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.