How do you delete files in VB.NET?
Last edited by JesusFreak; May 2nd, 2003 at 09:43 AM.
That if you confess with your mouth, "Jesus is Lord," and believe in your heart that God raised him from the dead, you will be saved.
VB Code: IO.File.Delete("c:\myfile.exe") There is a ton of good stuff in the IO namespace. The Path object also has some helpful functions.
IO.File.Delete("c:\myfile.exe")
Utility to Convert Visual Studio.NET 2003 Project Files Edneeis.com
Make sure that you wrap your file io operations in a try-catch block so your app doesn't crash when something unexpected happens.
My Site
At least make sure it exists: VB Code: If IO.File.Exists("c:\myfile.exe") Then IO.File.Delete("c:\myfile.exe") End If
If IO.File.Exists("c:\myfile.exe") Then IO.File.Delete("c:\myfile.exe") End If
Thanks for the help everyone!
Forum Rules