简体   繁体   English

IIS服务器上根目录的路径是什么?

[英]What is the path of the root directory on IIS server?

I'm attempting to write to a logfile, but File.Write(path, string) is not giving me access. 我正在尝试写入日志文件,但是File.Write(path, string)没有给我访问权限。

This is the error message: 这是错误消息:

Access to the path 'C:\Windows\SysWOW64\inetsrv\20130213190451765 49cb4a74-de61-49e5-93de-94d982073f89.txt' is denied.

The path is given via Server.MapPath("~") . 路径通过Server.MapPath("~") I'd advise against making the root folder of your site writeable in most cases. 建议不要在大多数情况下将您网站的根文件夹设为可写状态。 Why not choose a different, isolated location and give write permission to your app pool identity for that location? 为什么不选择其他隔离的位置,并为该位置的应用程序池标识赋予写权限?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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