为C ++中的所有用户添加读取权限 [英] Add read permission to a file for all users in C++

查看:92
本文介绍了为C ++中的所有用户添加读取权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在Windows 10上使用Visual Studio 2008,其中
AppLocker


我使用ofstream创建一个新文件。


切换用户时,我看到创建的文件没有读取权限没有创建文件的用户。


我想在C ++中以编程方式为所有用户添加读取权限。


我没有使用C ++ 17。


谢谢,


Zvika。

解决方案

< blockquote>



我在Windows 10上使用Visual Studio 2008,其中
AppLocker


我使用ofstream创建一个新文件。


切换用户时,我看到的文件是创建没有未创建文件的用户的读取权限。


我想在C ++中以编程方式为所有用户添加读取权限。


我没有使用C ++ 17.


谢谢,


Zvika。


请参阅
在C ++中修改对象的ACL


因此,您可以使用该示例向Everyone组授予GENERIC_READ权限。" - > b $ b


Hi,

I'm using Visual Studio 2008 on Windows 10 with AppLocker.

I create a new file using ofstream.

When switching a user, I see that the file that was created has no read permission by a user that didn't create the file.

I want to add read permission for all users programmatically in C++.

I'm not using C++17.

Thanks,

Zvika.

解决方案

Hi,

I'm using Visual Studio 2008 on Windows 10 with AppLocker.

I create a new file using ofstream.

When switching a user, I see that the file that was created has no read permission by a user that didn't create the file.

I want to add read permission for all users programmatically in C++.

I'm not using C++17.

Thanks,

Zvika.

See the discussion and sample code at Modifying the ACLs of an Object in C++

So you would use the sample to grant GENERIC_READ permission to the Everyone group.


这篇关于为C ++中的所有用户添加读取权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆