Go Back   RunUO - Ultima Online Emulation > Developer's Corner > Programming > C#

C# C# Discussion

Reply
 
Thread Tools Display Modes
Old 03-29-2008, 08:34 AM   #1 (permalink)
Forum Expert
 
Join Date: Dec 2003
Location: Sitting in a chair fulfilling my life's goal
Age: 22
Posts: 2,650
Send a message via AIM to Killamus Send a message via MSN to Killamus
Default Renaming exsisting files

Arg, my head hurts. I hated multi-dementional arrays in my C++ class, I still hate them.

In short: Program is designed to replace all of one letter with another as pertaining to a file name.
File gets renamed to said file name.
Problem:
File class contains no rename function. How do I do this?

Previously I've just used the copy function to make a new file, and then deleted the original.

Is this the only way to do it?
__________________
Procrastinators unite!
Tomorrow.
Saying that Java is nice because it works on all OS's is like saying that anal sex is nice because it works on all genders.
Killamus is offline   Reply With Quote
Old 03-29-2008, 01:23 PM   #2 (permalink)
Newbie
 
Join Date: Nov 2007
Age: 22
Posts: 69
Default

C# Move / Rename File (MoveTo)

Google is magical.
Chase.XNA is offline   Reply With Quote
Old 03-29-2008, 06:06 PM   #3 (permalink)
Forum Expert
 
Join Date: Oct 2003
Location: Calhoun, Ga
Age: 43
Posts: 985
Send a message via AIM to roadmaster
Default

Quote:
Originally Posted by Killamus View Post
Arg, my head hurts. I hated multi-dementional arrays in my C++ class, I still hate them.

In short: Program is designed to replace all of one letter with another as pertaining to a file name.
File gets renamed to said file name.
Problem:
File class contains no rename function. How do I do this?

Previously I've just used the copy function to make a new file, and then deleted the original.

Is this the only way to do it?

Quote:
Chase.XNA C# Move / Rename File (MoveTo)

Google is magical.
From the MSDN site:

MoveTo == Moves a specified file to a new location, providing the option to
specify a new file name.
__________________
If you are not a Moderator, don't try to moderate.
roadmaster is offline   Reply With Quote
Old 03-30-2008, 04:46 AM   #4 (permalink)
Forum Expert
 
TheOutkastDev's Avatar
 
Join Date: Sep 2002
Location: Houston, Texas
Age: 22
Posts: 3,933
Default

.Net framework doesn't contain a Rename function. However, if you use the File.Move( string, string ) method, you should get the same results.
TheOutkastDev is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5