如何获取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[^]