可以使用SetFilePermission (Win32 API)来设置NTFS上的文件和目录的权限
用法如下:
BOOL SetFilePermission(LPCTSTR lpFileName, // address of string for filename
SECURITY_INFORMATION SecurityInformation, // type of information to set
PSECURITY_DESCRIPTOR pSecurityDescriptor // address of security descriptor
); 请您参考下列API函数和数据结构以获得设置权限的进一步的信息:
ACL (DataStructure, Access Control List)
Get/SetSecurityDescriptorDacl
Get/SetSecurityDescriptorGroup
Get/SetSecurityDescriptorOwner
Get/SetSecurityDescriptorSacl另外, 就是用GetFilePermission
用法如下:
BOOL SetFilePermission(LPCTSTR lpFileName, // address of string for filename
SECURITY_INFORMATION SecurityInformation, // type of information to set
PSECURITY_DESCRIPTOR pSecurityDescriptor // address of security descriptor
); 请您参考下列API函数和数据结构以获得设置权限的进一步的信息:
ACL (DataStructure, Access Control List)
Get/SetSecurityDescriptorDacl
Get/SetSecurityDescriptorGroup
Get/SetSecurityDescriptorOwner
Get/SetSecurityDescriptorSacl另外, 就是用GetFilePermission
解决方案 »
- 想做类似WindowsXP开始菜单的系统菜单
- 【决战南非】世界杯只剩最后4场,押宝从速
- 程序中添加删除修改共用一个form
- 请教一个有关正则表达式的问题
- 菜鸟问一个关于端口的问题!
- 2000分(因为不能一次送出,我会分20次送完,食言是小狗),求解屏幕取汉字问题!
- List index out of bounds(1)!
- 请教个小问题~~~~~~~~~~~~~~~
- 对不起,各位请不要说我乱发贴子,因为我很着急!个人理财的软件,用什么软件好?家庭银行家(HomeBanker) V2.0 build 43 不太好用?
- 如何记录在windows中曾经浏览过的文字内容
- 用adotable的locate方法找到记录后,如何使DBGrid的这一条记录高亮显示?
- 为什么不能Update?
typedef struct _SECURITY_DESCRIPTOR {
BYTE Revision;
BYTE Sbz1;
SECURITY_DESCRIPTOR_CONTROL Control;
PSID Owner;
PSID Group;
PACL Sacl;
PACL Dacl;
} SECURITY_DESCRIPTOR, *PISECURITY_DESCRIPTOR, PSECURITY
文件和目录的权限
用法如下:
BOOL SetFilePermission(LPCTSTR lpFileName, // address of string for filename
SECURITY_INFORMATION SecurityInformation, // type of information to set
PSECURITY_DESCRIPTOR pSecurityDescriptor // address of security descriptor
); SECURITY_INFORMATION用于指示下面一个参数的类型, 它可以取如下的值:
OWNER_SECURITY_INFORMATION
文件和目录的所有者信息GROUP_SECURITY_INFORMATION
主组信息DACL_SECURITY_INFORMATION
自由的访问控制列表(ACL)信息SACL_SECURITY_INFORMATION
系统的访问控制列表(ACL)信息请您参考下列API函数和数据结构以获得设置权限的进一步的信息:
ACL (DataStructure, Access Control List)
Get/SetSecurityDescriptorDacl
Get/SetSecurityDescriptorGroup
Get/SetSecurityDescriptorOwner
Get/SetSecurityDescriptorSacl另外, 就是GetFilePermission, :)