how to rename a txt file VB.NET
-
how to rename a txt file i am able to file, Create, Delete ,, but how to rename a txt file VB.NET
-
how to rename a txt file i am able to file, Create, Delete ,, but how to rename a txt file VB.NET
-
Thanks for ur responce I am vc++ programmer new to .net i did the same but I am getting exception The process cannot access the file because it is being used by another process... this is the code oFile1.Delete("C:\WINDOWS\Doctors.txt") System.IO.File.Move("C:\Windows\tempdoc.txt", "C:\Windows\Doctors1.txt") 'oFile1.Move("c:\Windows\tempdoc.txt", "C:\Windows\Doctors1.txt") even the both r giving the samte error Can you Please Advice me
-
Thanks for ur responce I am vc++ programmer new to .net i did the same but I am getting exception The process cannot access the file because it is being used by another process... this is the code oFile1.Delete("C:\WINDOWS\Doctors.txt") System.IO.File.Move("C:\Windows\tempdoc.txt", "C:\Windows\Doctors1.txt") 'oFile1.Move("c:\Windows\tempdoc.txt", "C:\Windows\Doctors1.txt") even the both r giving the samte error Can you Please Advice me
If you have a reference to the file, you will have to call
Dispose
on it before you can rename/overwrite it. Also, please avoid using SMS Speak in the forums. Current blacklist svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour -
Thanks for ur responce I am vc++ programmer new to .net i did the same but I am getting exception The process cannot access the file because it is being used by another process... this is the code oFile1.Delete("C:\WINDOWS\Doctors.txt") System.IO.File.Move("C:\Windows\tempdoc.txt", "C:\Windows\Doctors1.txt") 'oFile1.Move("c:\Windows\tempdoc.txt", "C:\Windows\Doctors1.txt") even the both r giving the samte error Can you Please Advice me
This code works fine for me..
System.IO.File.Move("C:\Windows\tempdoc.txt", "C:\Windows\Doctors1.txt")
'The process cannot access the file because it is being used by another process' can be caused either a. tempdoc.txt is opened by some other application. b. tempdoc.txt is still open by your application and failed to close. -
If you have a reference to the file, you will have to call
Dispose
on it before you can rename/overwrite it. Also, please avoid using SMS Speak in the forums. Current blacklist svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviourcan u pls give me some example , delete file "a.txt" i need to rename a file rename "b.txt" as "a.txt", or overwite "a.txt" with "a.txt" oFile1.Delete("C:\WINDOWS\Doctors.txt") System.IO.File.Move("C:\Windows\tempdoc.txt", "C:\Windows\Doctors.txt") oFile1.Move -- modified at 5:52 Wednesday 7th June, 2006
-
This code works fine for me..
System.IO.File.Move("C:\Windows\tempdoc.txt", "C:\Windows\Doctors1.txt")
'The process cannot access the file because it is being used by another process' can be caused either a. tempdoc.txt is opened by some other application. b. tempdoc.txt is still open by your application and failed to close.Thanks u My dear Friend it my mistake!, I had not closed the file in overlook, and breaking my head from few hours Thanks a Lot Have a Nice day! Bye:) Understanding comes form failures Sucesses comes form Understanding failures -- modified at 5:59 Wednesday 7th June, 2006
-
can u pls give me some example , delete file "a.txt" i need to rename a file rename "b.txt" as "a.txt", or overwite "a.txt" with "a.txt" oFile1.Delete("C:\WINDOWS\Doctors.txt") System.IO.File.Move("C:\Windows\tempdoc.txt", "C:\Windows\Doctors.txt") oFile1.Move -- modified at 5:52 Wednesday 7th June, 2006
ptr_Electron wrote:
can u pls
Can you please use full sentences in the forum, in oppose to SMS Speak. Current blacklist svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour