简体   繁体   中英

C#, Web App on Server A writing files to server B

Ok, so I have a web app I'm developing on server 'A', and a folder ('F') that it reads/writes from/to on server 'B'. The web app on server 'A' is running under the identity 'Network Service' on A. On server B, 'Everyone' has permission to write to 'F', however when the app tries to write to this folder, it gets a permission denied error.

I'm somewhat inexperienced when it comes to permissions and such, so my question is, could it be that that the 'Network Service' account on 'A' isn't viewed as 'Everyone' on server 'B' and if so, is there a way to get around this without having to add that account to the 'Everyone' group?

Additional info:

  • Originally I was trying to write to the server like such:

    File.write( "\\B\c$\foobar\" + filename...

  • But I know theres issues with that so I changed to the following:

    File.write( "\\B\B-sharedfolder\foobar\" + filename...

Ok, so I solved it myself. It turns out that while the account did have permission to write to that folder, it didn't have permission to write to the share the folder was in. I fixed it simply by making a new share specifically for that folder, and then granting permission on that share to the account making the write.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM