本文介绍了获取文件系统限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想编写一个函数,告诉我是否可以将文件/文件夹写入特定路径。我想这样做,实际上没有写任何文件到磁盘。有没有WINAPI功能呢? 感谢您的帮助。
I would like to code a function that tells me if it's possible to WRITE a file/folder to a specific path or not. I would like to do that WITHOUT actually writing any file(s) to the disk. Is there a WINAPI function for that? Thank you for your help.
推荐答案您可以使用 GetFileSecurity()和 AccessCheck()功能。阅读Aaron Ballman关于如何检查访问权限的文章。他提供了 CanAccessFolder()函数来做你所要求的。
You can use GetFileSecurity() and AccessCheck() functions. Read the Aaron Ballman's article on How to Check Access Rights. He provided the CanAccessFolder() function to do what you asked.
更多推荐
获取文件系统限制
发布评论