2
在下面的代碼,我從客戶端PC更改應用程序的信任級別配置文件中
Dim fs
fs = Server.CreateObject("Scripting.FileSystemObject")
'If fs.FileExists(upfile.PostedFile.FileName) Then
fs.DeleteFile(upfile.PostedFile.FileName)
'End If
刪除文件在Web.config文件中,我還配置了信任水平。 :
<configuration>
<system.web>
<identity impersonate='true'/>
</system.web>
<location allowOverride="true">
<system.web>
<trust level="Full" originUrl="" />
</system.web>
</location>
....
在運行該應用程序時發生錯誤,它給出以下錯誤。如何更改安全設置?
描述:應用程序試圖執行安全策略不允許的操作。要授予此應用程序所需的權限,請聯繫您的系統管理員或更改配置文件中的應用程序信任級別。
異常詳細信息:System.Security.SecurityException:來自HRESULT的異常:0x800A0046(CTL_E_PERMISSIONDENIED)。