Results 1 to 2 of 2

Thread: Renaming a File? **SOLVED**

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member Sgt-Peppa's Avatar
    Join Date
    Mar 2003
    Location
    Munich - Germany
    Posts
    476

    Unhappy 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width