Welcome to Dream.In.Code
Become a VB Expert!

Join 137,233 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,739 people online right now. Registration is fast and FREE... Join Now!




deleting files

 
Reply to this topicStart new topic

deleting files, how do you delete a file?

orangeslide8
20 Mar, 2007 - 05:10 PM
Post #1

D.I.C Head
Group Icon

Joined: 29 Dec, 2006
Posts: 190



Thanked: 1 times
Dream Kudos: 25
My Contributions
does anyone know how to delete files?
thnx
john
User is offlineProfile CardPM
+Quote Post

m2s87
RE: Deleting Files
20 Mar, 2007 - 05:24 PM
Post #2

D.I.C Regular
Group Icon

Joined: 28 Nov, 2006
Posts: 390



Thanked: 1 times
Dream Kudos: 1225
My Contributions
QUOTE(orangeslide8 @ 21 Mar, 2007 - 03:10 AM) *

does anyone know how to delete files?
thnx
john

Did you mean delete from harddrive? Did you mean send the file to recycle bin? Did you mean delete a file from recycle bin? Did you mean delete permanatly? What basic are you using and on what platvorm?

Be besific, and do try to show some effort...

This post has been edited by m2s87: 20 Mar, 2007 - 05:25 PM
User is offlineProfile CardPM
+Quote Post

born2c0de
RE: Deleting Files
20 Mar, 2007 - 10:43 PM
Post #3

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 3,914



Thanked: 34 times
Dream Kudos: 2800
Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
If you want to send files to the Recycle bin, you'll need to use API Functions.
Although Deleting files can be done using the API too, you can also use the inbuilt Kill Function to do the job.

CODE
Kill "<filename>"

User is offlineProfile CardPM
+Quote Post

GaryOCo
RE: Deleting Files
23 Mar, 2007 - 04:46 PM
Post #4

New D.I.C Head
*

Joined: 23 Mar, 2007
Posts: 2


My Contributions
If you are going to use the Kill command make sure you warn your users of the danger involved and give them a chance to change their minds.

You could use code something like this, inserted just after they decide to delete the file but before it actually happens.

CODE

Select Case MsgBox("If you continue this file will be permanently removed from your system." _
                   & vbCrLf & "" _
                   & vbCrLf & "                             Do you want to proceed?" _
                   , vbYesNo Or vbExclamation Or vbDefaultButton1, "CAUTION!")

    Case vbYes
            Kill "<filename>"

    Case vbNo
            Exit Sub

End Select


It is good coding practice.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/4/08 03:48PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month