|
-
Sep 22nd, 2005, 02:03 PM
#1
Thread Starter
Frenzied Member
anyone know how i can just delete a text file?
e.g, if I want to delete C:\test.txt
-
Sep 22nd, 2005, 02:04 PM
#2
Re: anyone know how i can just delete a text file?
-
Sep 22nd, 2005, 10:10 PM
#3
Fanatic Member
Re: anyone know how i can just delete a text file?
in case the file doesn't exist...
VB Code:
On Error Resume Next
Kill "c:\peanutbutter.txt"
-
Sep 23rd, 2005, 12:17 AM
#4
Re: anyone know how i can just delete a text file?
And to avoid trapping/ignoring errors:
VB Code:
Declare Function DeleteFile Lib "kernel32" Alias "DeleteFileW" ( _
ByVal lpFileName As Long _
) As Long
' Usage:
DeleteFile StrPtr("C:\test.txt")
-
Sep 23rd, 2005, 01:22 AM
#5
Lively Member
Re: anyone know how i can just delete a text file?
 Originally Posted by Pouncer
e.g, if I want to delete C:\test.txt
Here:
IO.File.Delete("C:\test.txt")
sOMEONE'S gONNA dO iT, wHY nOT yOU ?
-
Sep 23rd, 2005, 01:26 AM
#6
Re: anyone know how i can just delete a text file?
 Originally Posted by FYRe
Here:
IO.File.Delete("C:\test.txt")

1) Only if you are using VB.NET
2) Only if you have imported the System namespace
-
Sep 23rd, 2005, 01:27 AM
#7
Re: anyone know how i can just delete a text file?
 Originally Posted by FYRe
Here:
IO.File.Delete("C:\test.txt")

That seems to be for .Net
-
Sep 23rd, 2005, 02:02 AM
#8
Lively Member
Re: anyone know how i can just delete a text file?
Oops..... sorry.
I've been browsing too many webpages in this forum, to have noticed that I actually posted here.. =)
FYRe
sOMEONE'S gONNA dO iT, wHY nOT yOU ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|