silverlight   发布时间:2022-05-04  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Silverlight使用HttpWebRequest和HttpWebResponse时发生System.Security.SecurityException: 安全性错误大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

异常代码发生在第二句 httpWebrequest request = result.AsyncState as httpWebrequest; WebResponse response = request.EndGetResponse(result); 提示信息: System.Security.SecurityException ---> System.Security.SecurityExc
@H_616_14@
@H_616_14@

异常代码发生在第二句


httpWebrequest request = result.AsyncState as httpWebrequest;

WebResponse response = request.EndGetResponse(result);


提示信息:

System.Security.SecurityException ---> System.Security.SecurityException: 安全性错误

   位于 System.Net.browser.browserhttpWebrequest.InternalEndGetResponse(IAsyncResult asyncResult)
   位于 System.Net.browser.browserhttpWebrequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendStatE)
   位于 System.Net.browser.AsyncHelper.<>c__DisplayClass2.<BeginOnUI>b__0(Object sendStatE)
   --- 内部异常堆栈跟踪的结尾 ---
   位于 System.Net.browser.AsyncHelper.beginOnUI(SendOrPostCallBACk beginMethod,Object statE)
   位于 System.Net.browser.browserhttpWebrequest.EndGetResponse(IAsyncResult asyncResult)

   位于 SilverlightApplication2.MainPage.ResponseCallBACk(IAsyncResult result)


解决

   在\webapps\ROOT\下增加两个文件

   crossdomain.xml和clientaccesspolicy.xml

------------------------------------------------------------------------

--crossdomain.xml--

------------------------------------------------------------------------

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYstem " http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all" />
<allow-access-from domain="*"/>
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>


------------------------------------------------------------------------

--clientaccesspolicy.xml--

------------------------------------------------------------------------

<?xml version="1.0" encoding="utf-8"?>             <access-policy> @R_262_1748@ <cross-domain-access> @R_262_1748@   <policy> @R_262_1748@     <allow-from http-request-headers="*"> @R_262_1748@       <domain uri="*"/> @R_262_1748@     </allow-from> @R_262_1748@     <grant-to> @R_262_1748@       <resource path="/" include-subpaths="true"/> @R_262_1748@     </grant-to> @R_262_1748@   </policy> @R_262_1748@ </cross-domain-access>             </access-policy>
@H_616_14@

大佬总结

以上是大佬教程为你收集整理的Silverlight使用HttpWebRequest和HttpWebResponse时发生System.Security.SecurityException: 安全性错误全部内容,希望文章能够帮你解决Silverlight使用HttpWebRequest和HttpWebResponse时发生System.Security.SecurityException: 安全性错误所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签:httpwebrequestsecuritysilverlightsystem使用发生安全性错误
猜你在找的silverlight相关文章
其他相关热搜词更多
phpJavaPython程序员load如何string使用参数jquery开发安装listlinuxiosandroid工具javascriptcap