Recovery tool
Posted: Mon Mar 12, 2012 1:43 pm
Does anyone know if it is posible to make an recovery tool in vb.net to recover deleted files when you have removed files from recycle bin. If so please make a tutorial 

Sharing, Teaching and Supporting coders of all ages and levels since 2009
https://www.codenstuff.com/forum/
<DllImport("kernel32.dll")> Shared Function CreateFile(ByVal lpFileName As String, ByVal dwDesiredAccess As UInteger, ByVal dwShareMode As UInteger, ByVal lpSecurityAttributes As IntPtr, ByVal dwCreationDisposition As UInteger, ByVal dwFlagsAndAttributes As UInteger, ByVal hTemplateFile As IntPtr) As IntPtr
End Function
Private Sub btnTest_Click(sender As System.Object, e As System.EventArgs) Handles btnTest.Click
Dim driveHandle As IntPtr = CreateFile("\\.\C:", IO.FileAccess.Read, IO.FileShare.ReadWrite, IntPtr.Zero, IO.FileMode.Open, 0, IntPtr.Zero)
Dim safeDriveHandle As SafeFileHandle = New SafeFileHandle(driveHandle, True)
Dim fs As FileStream = New FileStream(safeDriveHandle, FileAccess.Read)
Dim data(512 - 1) As Byte
Dim read As Integer = fs.Read(data, 0, data.Length)
fs.Close()
MsgBox("read " & read & " bytes")
End Sub