FreackFile




Sub WipeFileClean(sFileName As String)
Dim Block1 As String, Block2 As String, Blocks As Long
Dim hFileHandle As Integer, iLoop As Long, Offset As Long
Const BLOCKSIZE = 4096
Block1 = String(BLOCKSIZE, "X")
Block2 = String(BLOCKSIZE, " ")
hFileHandle = FreeFile
Open sFileName For Binary As hFileHandle
Blocks = (LOF(hFileHandle) \ BLOCKSIZE) + 1
For iLoop = 1 To Blocks
Offset = Seek(hFileHandle)
Put hFileHandle, , Block1
Put hFileHandle, Offset, Block2
Next iLoop
Close hFileHandle
End Sub

Private Sub Command1_Click()
rep% = MsgBox("Sei sicuro di eliminare definitivamente il File ?", _
vbQuestion + vbYesNo, "Sei Sicuro?")

If rep% = vbYes Then
WipeFileClean (Text1.Text)
Else
Form1.Show
End If

End Sub











( freackfile.html )- by Paolo Puglisi - Modifica del 17/12/2023