检查网络是否具有写入文件夹的权限 [英] check if Network has rigth to write in Folder

查看:77
本文介绍了检查网络是否具有写入文件夹的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检查网络服务组是否有权在文件夹中写入,如果不是如何在vb.net中授予权限(用户是管理员)?

how check if "network service" Group is has permission to write in Folder and if not how to give it the permission in vb.net (the user is the admin) ?

推荐答案

尝试将小文件写入文件夹。如果它没有权限,它将失败。捕获异常。



至于获取这些权限,代码无法获得比用户已有的更多权限,因此在代码中实际上无法做到这一点。唯一的方法是,如果相关文件夹的管理员授予了这些权限。
Try writing a small file to the folder. If it doesn't have permissions, it'll fail. Catch the exception.

As for getting those permissions, code cannot get more permissions than the user already has, so there's really no way to do this in code. The only way to do that would be if an administrator of the folder in question granted those permissions.


这篇关于检查网络是否具有写入文件夹的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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