如何获取Windows服务c#的网络文件夹路径的访问权限? [英] How to get access rights to the network folder path for a windows service c#?

查看:437
本文介绍了如何获取Windows服务c#的网络文件夹路径的访问权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取Windows服务c#的网络文件夹路径的访问权限?我正在将文件从我的机器移动到共享网络路径。 Winodws服务作为本地系统帐户运行。从我的机器的源文件夹中将Everyone的权限授予目标文件夹。但我得到访问被拒绝错误。如果我在我的系统上运行它的罚款。

以下是我的源和目标文件夹路径。

How to get access rights to the network folder path for a windows service c#? I am moving files from my machine to a shared network path. Winodws service is running as local system account. Gave permissions to Everyone to the destination folder from the source folder of my machine. But I am getting Access Denied Error. If I am running on my system its fine.
The following are my source and destination folder paths.

<add key="OrginalFolderPath"  value="C:\TEMP\FileUpload\"/>
        <add key="FileBakupPath"  value ="\\nestit-225\ARCHIVALFOLDER\"/>

推荐答案

从下面查看文件访问权限设置

sharing-permissions.html [ ^ ]



并分享您的文件夹

http://www.qnap.com/index.php?sn=2718 [ ^ ]



设置每个人并通过代码勾选除完全控制之外的所有方框

add-everyone-privilege-to-folder-using-c-net [ ^ ]
See file access permission setting from below
sharing-permissions.html[^]

and share your folder
http://www.qnap.com/index.php?sn=2718[^]

Set Everyone" and ticked all boxes except "Full Control" by code
add-everyone-privilege-to-folder-using-c-net[^]


这篇关于如何获取Windows服务c#的网络文件夹路径的访问权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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