Rename Folder
-
Hi guys I am creating folder thru asp.net with help of System.IO.Directory.CreateDirectory("Name") Now i want to rename this directory. So some of members gave me suggestion to use System.IO.Directory.Move(OldFile,NewFile) But this is not working in my case as i am storing this in one location, So it is giving me error that "Source and destination path must be different." SO if any one have any idea please let me know Thanks in advance
Regards, DJ Rock
-
Hi guys I am creating folder thru asp.net with help of System.IO.Directory.CreateDirectory("Name") Now i want to rename this directory. So some of members gave me suggestion to use System.IO.Directory.Move(OldFile,NewFile) But this is not working in my case as i am storing this in one location, So it is giving me error that "Source and destination path must be different." SO if any one have any idea please let me know Thanks in advance
Regards, DJ Rock
-
But that seems to be OK. Are you giving both the parameters same?
Best Regards, Apurva Kaushal
no i am giving file name different but it is at same place like i have following path D:/Folders/Temp1 and i want to rename Temp1 to Temp2 ok? so i am passing System.IO.Directory.Move("D:\Folders\" & oldName, "D:\Folders\" & NewName) Tell me is it ok?? then why it is giving me error like Must not be same path??::(
Regards, DJ Rock
-
no i am giving file name different but it is at same place like i have following path D:/Folders/Temp1 and i want to rename Temp1 to Temp2 ok? so i am passing System.IO.Directory.Move("D:\Folders\" & oldName, "D:\Folders\" & NewName) Tell me is it ok?? then why it is giving me error like Must not be same path??::(
Regards, DJ Rock