如何判断在当前文件夹有无创建新文件的权限 RT.例如该文件夹为D:\abc。我想知道当前运行的用户有无在D:\abc这个文件夹里面创建文件的权限。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个函数用起来比较复杂。简单的方式是你用CreateFile直接在目录下创建文件,看返回错误码是拒绝访问或没有权限来测试。 函数AddAccessRights实现为文件(目录)添加一个帐户(组)的权限函数GetAccountRights实现获取该文件(目录)指定帐户(组)的权限 BOOL WINAPI GetFileSecurity( __in LPCTSTR lpFileName, __in SECURITY_INFORMATION RequestedInformation, __out_opt PSECURITY_DESCRIPTOR pSecurityDescriptor, __in DWORD nLength, __out LPDWORD lpnLengthNeeded);DWORD WINAPI GetNamedSecurityInfo( __in LPTSTR pObjectName, __in SE_OBJECT_TYPE ObjectType, __in SECURITY_INFORMATION SecurityInfo, __out_opt PSID *ppsidOwner, __out_opt PSID *ppsidGroup, __out_opt PACL *ppDacl, __out_opt PACL *ppSacl, __out_opt PSECURITY_DESCRIPTOR *ppSecurityDescriptor);BOOL WINAPI GetSecurityDescriptorOwner( __in PSECURITY_DESCRIPTOR pSecurityDescriptor, __out PSID* pOwner, __out LPBOOL lpbOwnerDefaulted );GetSecurityDescriptorControlGetSecurityDescriptorDaclGetSecurityDescriptorGroupGetSecurityDescriptorLengthGetSecurityDescriptorOwnerGetSecurityDescriptorRMControlGetSecurityDescriptorSaclInitializeSecurityDescriptorIsValidSecurityDescriptorSetSecurityDescriptorDaclSetSecurityDescriptorGroupSetSecurityDescriptorOwnerSetSecurityDescriptorRMControlSetSecurityDescriptorSacl这些应该够用了 lz 这个方式简单是简单,但是如果你创建成功的话,会在目录出现一个测试用权限用的文件。然后需要使用DeleteFile来删除,但是这个删除会在回收站出现。必须通过什么方法来直接删除(不经过回收站)呢? DeleteFile是直接删除的啊,咋会到回收站里,没遇到过。 关于显示和隐藏DialogBar FIONBIO有什么用? 游戏外挂钩子程序,在线等! 如何把一幅图片复制到内存dc中啊 就10分了,问一个字符串转换问题? 如何截获Alt+Tab和Ctrl+Alt+Del?以及控制鼠标范围 我想做一个类似Exchange的邮件 服务器 ,请问哪里有这样的资料? 我的可用分好几天不长了 MFC静态切分窗体问题 谁知道哪里可以下载到中文版的thinking in c++?? ListBox右键菜单的问题 菜鸟来送分啦,WINCE开发WTL程序运行怎么没有菜单栏,最大化的样子
__in LPCTSTR lpFileName,
__in SECURITY_INFORMATION RequestedInformation,
__out_opt PSECURITY_DESCRIPTOR pSecurityDescriptor,
__in DWORD nLength,
__out LPDWORD lpnLengthNeeded
);DWORD WINAPI GetNamedSecurityInfo(
__in LPTSTR pObjectName,
__in SE_OBJECT_TYPE ObjectType,
__in SECURITY_INFORMATION SecurityInfo,
__out_opt PSID *ppsidOwner,
__out_opt PSID *ppsidGroup,
__out_opt PACL *ppDacl,
__out_opt PACL *ppSacl,
__out_opt PSECURITY_DESCRIPTOR *ppSecurityDescriptor
);BOOL WINAPI GetSecurityDescriptorOwner
( __in PSECURITY_DESCRIPTOR pSecurityDescriptor,
__out PSID* pOwner, __out LPBOOL lpbOwnerDefaulted );GetSecurityDescriptorControl
GetSecurityDescriptorDacl
GetSecurityDescriptorGroup
GetSecurityDescriptorLength
GetSecurityDescriptorOwner
GetSecurityDescriptorRMControl
GetSecurityDescriptorSacl
InitializeSecurityDescriptor
IsValidSecurityDescriptor
SetSecurityDescriptorDacl
SetSecurityDescriptorGroup
SetSecurityDescriptorOwner
SetSecurityDescriptorRMControl
SetSecurityDescriptorSacl这些应该够用了 lz
然后需要使用DeleteFile来删除,但是这个删除会在回收站出现。
必须通过什么方法来直接删除(不经过回收站)呢?