Rename a file from his String Path [Resolved]
-
Hi guys, How can I rename my file defined by my string Path? I want to pass from : TXTFile_rfcyxt55efrem1fj4sycjv5527-04-2011_17h-4641_0.txt to Entite1.txt ty for u help
modified on Thursday, April 28, 2011 4:47 AM
-
Hi guys, How can I rename my file defined by my string Path? I want to pass from : TXTFile_rfcyxt55efrem1fj4sycjv5527-04-2011_17h-4641_0.txt to Entite1.txt ty for u help
modified on Thursday, April 28, 2011 4:47 AM
-
Renaming works the same as moving.
File.Move("TXTFile_rfcyxt55efrem1fj4sycjv5527-04-2011_17h-4641_0.txt", "Entite1.txt");
See also: http://msdn.microsoft.com/en-us/library/system.io.file.move.aspx[^]
Hi, File.Move is good solution also File.CopyTo(olderpath, NewPath) is also well working) Ty
-
Hi, File.Move is good solution also File.CopyTo(olderpath, NewPath) is also well working) Ty
file raname using
Regex
like this newfilename = Regex.Replace(fDialog.FileName, "F.NCF", "H.NCF");-ambarish-
-
file raname using
Regex
like this newfilename = Regex.Replace(fDialog.FileName, "F.NCF", "H.NCF");-ambarish-
That just changes strings. It doesn't touch the file at all.
Forgive your enemies - it messes with their heads
My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility