我该如何解决UnauthorisedAccessException [英] how do i solve the UnauthorisedAccessException

查看:158
本文介绍了我该如何解决UnauthorisedAccessException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试将文件上传到服务器上的目录时,我一直收到此错误.

System.UnauthorizedAccessException:拒绝访问路径"C:\ Users \ Fafa \ Documents \ Visual Studio 2010 \ Projects \ IBGTxalert \ TxAlert \ TxAlert.Web \ Files \ linqtoexcel2.xls".

I keep getting this error when i try to upload files onto a directory on my server.

System.UnauthorizedAccessException: Access to the path ''C:\Users\Fafa\Documents\Visual Studio 2010\Projects\IBGTxalert\TxAlert\TxAlert.Web\Files\linqtoexcel2.xls'' is denied.

any help on how to solve this will be deeply appreciated

推荐答案

您将无法访问文件夹或网站所在虚拟文件夹之外的文件.这是安全的事情.您唯一可以做的就是将所需文件移动到网站文件夹中的某个位置.
You can''t access folders or files outside the virtual folder where your web site lives. It''s a security thing. The only thing you can do is move the desired file to a place INSIDE your web site folder.


这篇关于我该如何解决UnauthorisedAccessException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆