C# 用于web开发的C语言中的安全异常

C# 用于web开发的C语言中的安全异常,c#,asp.net,visual-studio,.net,web-development-server,C#,Asp.net,Visual Studio,.net,Web Development Server,我目前正在使用C开发一个网站,我尝试使用一个数据文件来存储一些临时数据。我使用System.IO.StreamReader和System.IO.StreamWriter修改数据。但是,在我将文件上载到oneline服务器后,我在运行我的站点时遇到以下异常: [System.Security.SecurityException]: Request for the permission of type 'System.Security.Permissions.FileIOPermission, ms

我目前正在使用C开发一个网站,我尝试使用一个数据文件来存储一些临时数据。我使用System.IO.StreamReader和System.IO.StreamWriter修改数据。但是,在我将文件上载到oneline服务器后,我在运行我的站点时遇到以下异常:

[System.Security.SecurityException]: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
[Descritpion]:The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. 
之后,我尝试通过在[system.web][/system.web]之间的web.config文件中添加[trust level=Full]来设置信任级别。我遇到以下异常:

 This configuration section cannot be used at this path. This happens when the site administrator has locked access to this section using from an inherited configuration file.
我想知道这个配置文件在哪里,如何解决这个问题? 提前谢谢


现在这个问题已经解决了,解决这个问题的方法是使用MapPath~/foldername/file,而不是直接使用path目录。它创建了一个虚拟目录,您可以在Godaddy服务器上为其调整权限

您试图修改的文件是什么,包括路径?存储文件夹是否具有“NetworkService”权限?@ConradFrix该文件是一个简单的文本文件,在我将其上载到服务器后,我可以通过internet读取该文件。@cinek我想我设置了文件所在的文件夹以授予修改权限,我使用godaddy.com来托管我的网站,它有一个文件管理部分,我在那里更改了设置