Mega Code Archive

 
Categories / Delphi / Files
 

TWFolderProtector 1.10 [090317]

Title: TWFolderProtector 1.10 [090317] Question: How to protect your folder by code? Answer: This component is free (with full source code & demo). Homepage: http://my.opera.com/makar0g/blog/wfolder-protector-d7 Download: please visit homepage and get more informations with links. Samples: TWFolderProtector = class(TComponent) private FFolders: TStringList; function GetFolderCount: Integer; function GetAbout: WideString; procedure SetAbout(const Value: WideString); function GetAboutEx: WideString; procedure SetAboutEx(const Value: WideString); public constructor Create(AOwner: TComponent); override; destructor Destroy; override; function DoProtect(FolderName: WideString; ShareMod: Cardinal): Boolean; virtual; function UnProtect(FolderName: WideString): Boolean; overload; virtual; function UnProtect(Index: Integer): Boolean; overload; procedure UnProtectAll; function FolderName(Index: Integer): WideString; virtual; function FolderIndex(Name: WideString): Integer; virtual; function FolderExists(Name: WideString): Boolean; virtual; published property Count: Integer read GetFolderCount; property About: WideString read GetAbout write SetAbout; property AboutEx: WideString read GetAboutEx write SetAboutEx; end; Using: ... procedure TForm1.Button1Click(Sender: TObject); begin ShowMessage(BoolToStr( WFolderProtector1.DoProtect('D:\Temp', FILE_SHARE_EXCLUSIVE), True)); end; === Sorry for my bad E...