|
-
Jul 22nd, 2003, 07:40 AM
#1
Thread Starter
Hyperactive Member
Renaming a File? **SOLVED**
Hey ya`ll,
i`ve created a file called GUID.tmp. What I want to to now, is to rename that file to GUID.xml
How can achieve this?
Heres some code I use:
Code:
//write file
string path = @"D:\Projects\x400_Adapter\Solution\Outbound\"+ partner + @"\" + mappedid + ".tmp";
StreamWriter finaldoc = new StreamWriter(path,false);
finaldoc.Write(message);
finaldoc.Close();
//rename file
if(File.Exists(path))
{
FileInfo Info = new FileInfo(path);
Info.Name = Guid.NewGuid().ToString(); //this is not working:-) Name is read only!
}
return "OK";
Thanx, Stephan
Last edited by Sgt-Peppa; Jul 22nd, 2003 at 08:10 AM.
Keep Smiling - even if its hard 
Frankie Says Relax, wossname Says Yeah!
wossname:--Currently I'm wearing a gimp suit and a parachute.
C# - Base64 Blog
-
Jul 22nd, 2003, 08:10 AM
#2
Thread Starter
Hyperactive Member
Ok solved it again
its the moveto operation!
Thanx anyways!
Stephan
Keep Smiling - even if its hard 
Frankie Says Relax, wossname Says Yeah!
wossname:--Currently I'm wearing a gimp suit and a parachute.
C# - Base64 Blog
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|