我该如何解决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.