可以使用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
解决方案 »
- 新人求教SQL语句里需要用到数字类型的变量要怎么写
- 控制窗体焦点的问题...
- 高分求TRxTrayIcon,TNMUDP,TColorCombobox , TdxSideBar TRxTimerList ThotKeySpy 控件
- 技术交流
- 关于panel的入门级的问题。
- 求进程管理源代码
- 有谁有中国期刊网的用户和密码?
- 在paradox数据库里,怎样用SQL语句限制返回的记录数(前10条记录)?
- 我要向老板要求我的工资怎么制定,谁能给我个范文吗
- 高手们指点:怎样成为delphi高手,是否必须先成为VC高手!
- 用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, :)