Lost Password?


  #1 (permalink)  
Old 11-25-2006, 08:32 AM
TcM's Avatar   
TcM TcM is offline
Code Warrior
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 8,332
Credits: 0
Rep Power: 68
TcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of light
Default VB6.0:Tutorial, WipeFile

Introduction:-
Welcome to another tutorial of VB, in this tutorial I will tell you on how to delete a program permanently! how? simple just first we open the file replace it with and letter, number or symbol we want then delete it! So even if the file is brought back after deletion with any special software it will still be not accessible!

Solution:-
Well I will show you just the basics, because in my original program I made more but here I will just place the basic for newbies to understand better!
Ok so first we have to include the component of the CommonDialog here is how:-


and Select:-


Then Add a Command button

Add This Code:-

Code:
Sub Wipe(FileName As String)
On Error GoTo err
  Dim Part1 As String
  Dim hFileHandle As Integer, i As Long
  Const SIZE = 1024
  Part1 = String(SIZE, "#")
  hFileHandle = FreeFile
    
    Open FileName For Binary As hFileHandle
    For i = 1 To hFileHandle
    Put hFileHandle, , Part1
    Next i
    Close hFileHandle
Exit Sub
err:
   Exit Sub
End Sub

Private Sub Command1_Click()
CommonDialog1.ShowOpen
Wipe CommonDialog1.FileName
Kill CommonDialog1.FileName
MsgBox "File Deleted Safely", vbInformation, "WipeFile"
End Sub
Explanation:-
Code:
Sub Wipe(FileName As String)
This is the sub we will call to delete the file when pressing the command button

Code:
On Error GoTo err
For a better explanation read this tutorial:-
Code:
  Dim Part1 As String
  Dim hFileHandle As Integer, i As Long
  Const SIZE = 1024
  Part1 = String(SIZE, "#")
  hFileHandle = FreeFile
Here we are declaring some variables etc.. and assigning some things
the important thing here is the line 'Part1 = String(SIZE, "#")' the symbol # means what you want to replace every bit with! you can change it to 0 or so! for example if you try this on an exe file and then open it with a HEX viewer all you see will be that symbol!
like this:-


Code:
    Open FileName For Binary As hFileHandle
    For i = 1 To hFileHandle
    Put hFileHandle, , Part1
    Next i
    Close hFileHandle
Here we are opening the file as binary then we loop to replace everything with a # when everything is replaced we close the file!

Code:
Private Sub Command1_Click()
CommonDialog1.ShowOpen
Wipe CommonDialog1.FileName
Kill CommonDialog1.FileName
MsgBox "File Deleted Safely", vbInformation, "WipeFile"
End Sub
When we press the command button the Open Dialog will be showed, then you choose a file to delete "WARNING FILE WILL BE PERMANENTLY DELETED!!" and after that we call the Sub Wipe to replace it with the symbol after we kill the file ( delete ) and then it shows a msgbox saying that the file was deleted!

NOTE:- To see that this really works delete the line that says 'Kill CommonDialog1.FileName' then go to that file, open it with a hex editor and you will see that this really works!! all you will see is that symbol you specify!!
As i already showed you here is what you will see:-


Conclusion:-
As Always Feedback is welcome and the full source is attached!! NOTE:- The source code is a little modified and contains more functions! If you don't have VB installed and can't run the code but you need the program, just request here and I will upload the EXE file for those without VB installed
Attached Files To view attachments in this forum your post count must be 1 or greater. You currently have 0 posts.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 11-28-2006, 09:25 AM
Cosmet Cosmet is offline
Learning Programmer
 
Join Date: Oct 2006
Posts: 58
Credits: 0
Rep Power: 8
Cosmet is on a distinguished road
Default

Wow, nice tutorial! I was thinking about creating this myself the other day. This basically overwrites the file with bad data so if it is recovered, it means nothing! Cheers!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-28-2006, 09:34 AM
TcM's Avatar   
TcM TcM is offline
Code Warrior
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 8,332
Credits: 0
Rep Power: 68
TcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of light
Default

Yup thats the purpose! and it works!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 12-01-2006, 01:39 PM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 9,127
Last Blog:
Ext JS or Ext GWT
Credits: 1
Rep Power: 20
Jordan is just really niceJordan is just really niceJordan is just really niceJordan is just really nice
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

Nice tutorial, rep left.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 12-01-2006, 01:42 PM
TcM's Avatar   
TcM TcM is offline
Code Warrior
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 8,332
Credits: 0
Rep Power: 68
TcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of light
Default

Quote:
Originally Posted by Jordan View Post
Nice tutorial, rep left.
Thanks for that
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 01-01-2008, 03:18 PM
hackimi hackimi is offline
Newbie
 
Join Date: Jan 2008
Posts: 1
Credits: 0
Rep Power: 0
hackimi is on a distinguished road
Default

thanks for view code
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-28-2008, 05:49 PM
K3Y K3Y is offline
Newbie
 
Join Date: Feb 2008
Posts: 17
Credits: 0
Rep Power: 3
K3Y is on a distinguished road
Default

great tut, thanks


easy to follow, and it will come into use into the program im writing =D

cheers dude
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 06-06-2008, 02:43 PM
TcM's Avatar   
TcM TcM is offline
Code Warrior
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 8,332
Credits: 0
Rep Power: 68
TcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of light
Default Re: VB6.0:Tutorial, WipeFile

Welcome mate.

What program is that?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 06-11-2008, 12:33 PM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: London, England
Posts: 9,405
Last Blog:
Web slideshow in JavaS...
Credits: 2,576
Rep Power: 75
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
Default Re: VB6.0:Tutorial, WipeFile

Um, a program deletion program?
__________________


Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
VB6.0:Tutorial, Command Line TcM VB Tutorials 9 08-25-2008 01:19 PM
VB6.0:Tutorial, Error handling TcM VB Tutorials 9 06-06-2008 02:31 PM


All times are GMT -5. The time now is 07:23 AM.

Contest Stats

WingedPanther ........ 2656.49
Xav ........ 2576.41
Brandon W ........ 1697.27
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 959.05
dcs ........ 646.09
Steve.L ........ 475.59
orjan ........ 407.96
chili5 ........ 380.6

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 97%

Ads