写从符文件 [英] write a file from webservices
问题描述
我有一个Web服务使用.NET C#和我想写到服务器上的一个文本文件,但我不能得到这个工作。我相信这是一个权限问题。
I have a web service using .net c# and I want to write to a text file on the server, but I cannot get this to work. I believe it's a permission problem.
具体而言,我认为这个问题是我使用 System.IO.Directory.GetCurrentDirectory()
。
Specifically, I think the problem is I am using System.IO.Directory.GetCurrentDirectory()
.
有没有更好的选择?
推荐答案
尝试授予ASP.NET用户(或任何账户IIS是为运行)权限给你写信试图写入该文件夹。
Try granting the ASP.NET user (or whatever account IIS is running as) permission to write to the folder you are trying to write to.
如果这是一个网络共享,尝试运行IIS作为可以写入共享的域用户。
If this is a network share, try to run IIS as a domain user that can write to the share.
记住授予最小权限原则(不使用管理员级别的访问)。
Remember the principle of granting minimal permission (dont use Admin level access).
这篇关于写从符文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!