C# .NET - making data recovery software -
Hi
refer the links
it might help you
http://www.c-sharpcorner.com/Forums/Thread/54387/
http://www.freelancer.com/projects/Java-Visual-Basic/Data-recovery-software.723158.html
refer the links
it might help you
http://www.c-sharpcorner.com/Forums/Thread/54387/
http://www.freelancer.com/projects/Java-Visual-Basic/Data-recovery-software.723158.html

Riley K replied to murtaza rampurawala on 14-Jun-11 04:10 AM
Hi
I dont think there are any classes to do this in C#. You need to use some free softwares to do this.
http://lifehacker.com/393084/how-to-recover-deleted-files-with-free-software

Jitendra Faye replied to murtaza rampurawala on 14-Jun-11 04:11 AM
Such an application I believe uses low level APIs. You must first find a way to scan the harddrive for deleted data, and then process that data to find typical file type headers. C# like most other languages can certanly be used to process the data once you find it.
follow this link-
http://www.codeproject.com/Messages/3553742/Csharp-program-to-recover-data.aspx
Hope this will help you.
follow this link-
http://www.codeproject.com/Messages/3553742/Csharp-program-to-recover-data.aspx
Hope this will help you.

Kirtan Patel replied to murtaza rampurawala on 14-Jun-11 04:53 AM
you can start by using win32 API Functions to access the FAT allocation table of recovery
[DllImport("kernel32.dll", CharSet=CharSet.Auto)] static extern IntPtr FindFirstFile(string lpFileName, out WIN32_FIND_DATA lpFindFileData);Here is sample code how to use that code
[DllImport("kernel32.dll", CharSet=CharSet.Auto)] static extern IntPtr FindFirstFile(string lpFileName, out WIN32_FIND_DATA lpFindFileData); [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] static extern SafeFindHandle FindFirstFile(string lpFileName, out WIN32_FIND_DATA lpFindFileData); [DllImport("kernel32.dll", SetLastError = true)] static extern bool FindClose(SafeHandle hFindFile); [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] static extern bool FindNextFile(SafeHandle hFindFile, out WIN32_FIND_DATA lpFindFileData); internal sealed class SafeFindHandle : SafeHandleZeroOrMinusOneIsInvalid { // Methods [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] internal SafeFindHandle() : base(true) { } public SafeFindHandle(IntPtr preExistingHandle, bool ownsHandle) : base(ownsHandle) { base.SetHandle(preExistingHandle); } protected override bool ReleaseHandle() { if (!(IsInvalid || IsClosed)) { return FindClose(this); } return (IsInvalid || IsClosed); } protected override void Dispose(bool disposing) { if (!(IsInvalid || IsClosed)) { FindClose(this); } base.Dispose(disposing); } } private long RecurseDirectory(string directory, int level, out int files, out int folders) { IntPtr INVALID_HANDLE_VALUE = new IntPtr(-1); long size = 0; files = 0; folders = 0; Kernel32.WIN32_FIND_DATA findData; // please note that the following line won't work if you try this on a network folder, like \\Machine\C$ // simply remove the \\?\ part in this case or use \\?\UNC\ prefix using(SafeFindHandle findHandle = Kernel32.FindFirstFile(@"\\?\" + directory + @"\*", out findData)) { if (!findHandle.IsInvalid) { do { if ((findData.dwFileAttributes & FileAttributes.Directory) != 0) { if (findData.cFileName != "." && findData.cFileName != "..") { folders++; int subfiles, subfolders; string subdirectory = directory + (directory.EndsWith(@"\") ? "" : @"\") + findData.cFileName; if (level != 0) // allows -1 to do complete search. { size += RecurseDirectory(subdirectory, level - 1, out subfiles, out subfolders); folders += subfolders; files += subfiles; } } } else { // File files++; size += (long)findData.nFileSizeLow + (long)findData.nFileSizeHigh * 4294967296; } } while (Kernel32.FindNextFile(findHandle, out findData)); } } return size; }

【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 一个奇形怪状的面试题:Bean中的CHM要不要加volatile?
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战