Click here to Skip to main content
12,244,489 members (45,007 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB VB.NET
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 19-Dec-12 0:39am

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160426.1 | Last Updated 21 Dec 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100