拒绝访问路径"C:\ Sites \ content \ ServerIpAddress.txt" [英] Access to the path 'C:\Sites\content\ServerIpAddress.txt' is denied
问题描述
我创建了一个网站,该网站在其默认"网页中尝试访问服务器上的ServerIpAddress.txt文件.现在,当我在本地主机上运行我的项目时,它可以正常工作,但是当我将其上传到Server(免费主机)上时,我会遇到
I create a web site that in Default web page of it i try to access to ServerIpAddress.txt file that is on server . now when i run my project on local host it work correctly , but when I upload it on Server(free host) i face with
错误.有人可以帮我吗?
error. can some one help me ?
推荐答案
由于安全问题,您很可能没有权限访问共享服务器上的文件.考虑将数据从该文件移至web.config应用程序密钥.
You most likely do not have permissions access files on the shared server due to security issues. Consider moving data from that file to web.config app key.
或访问该文件作为您站点的相对路径.远程服务器很可能不会与本地计算机具有相同的文件夹结构.
or access the file as a relative path to your site. The remote sever will most likely not have the same folder structure as your local machine.
这篇关于拒绝访问路径"C:\ Sites \ content \ ServerIpAddress.txt"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!