Click here to Skip to main content
15,890,897 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear sir


I want to develop an desktop application which protect my folder or file.
when somebody deleted then it will ask password, if it is correct then the action is done otherwise there will be no effect on file or folder.



Please somebody help me
Posted

1 solution

Windows NTFS does not support such a thing.

Really, if you understood Windows and NTFS security and what well-known folder yo put the data you want protected under, you would know that what you want to do is utter non-sense.
 
Share this answer
 
Comments
ravi kumar86 20-Dec-12 3:59am    
i sent a software link please go through it and then tell me how it do?

http://www.softpedia.com/get/Security/Lockdown/Folder-Protect.shtml
Dave Kreskowiak 20-Dec-12 7:43am    
Wow. A piece of software that solves a problem that doesn't exist.
ravi kumar86 21-Dec-12 2:44am    
http://www.newsoftwares.net/folder-protect/
ravi kumar86 21-Dec-12 2:48am    
ihave attached a soft link and , what i have done in my code but it is not so effective as the software work suggest above link. so please tell me how can i achive it?
ravi kumar86 21-Dec-12 2:51am    
AddDirectorySecurity(dt1.Rows(i)("FullPath"), WindowsIdentity.GetCurrent().Name, FileSystemRights.Delete, AccessControlType.Deny)
AddDirectorySecurity(dt1.Rows(i)("FullPath"), WindowsIdentity.GetCurrent().Name, FileSystemRights.DeleteSubdirectoriesAndFiles, AccessControlType.Deny)
AddDirectorySecurity(dt1.Rows(i)("FullPath"), WindowsIdentity.GetCurrent().Name, FileSystemRights.Write, AccessControlType.Deny)




Sub AddDirectorySecurity(ByVal FileName As String, ByVal Account As String, ByVal Rights As FileSystemRights, ByVal ControlType As AccessControlType)
Dim dInfo As New DirectoryInfo(FileName)
Dim dSecurity As DirectorySecurity = dInfo.GetAccessControl()
dSecurity.AddAccessRule(New FileSystemAccessRule(Account, FileSystemRights:=Rights, InheritanceFlags:=InheritanceFlags.ContainerInherit Or InheritanceFlags.ObjectInherit, PropagationFlags:=PropagationFlags.InheritOnly, Type:=ControlType))
If ControlType = AccessControlType.Deny Then
dSecurity.SetAccessRuleProtection(True, False)
Else
dSecurity.SetAccessRuleProtection(False, True)
End If
Directory.SetAccessControl(FileName, dSecurity)
End Sub

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900