The primary reason is that the browser plugin networking APIs only support
async calls on the UI thread. This means we are blocked from supporting
sync requests on the UI thread. (If we blocked on the UI thread,we would never get the response callback from the browser.) Looking at an API friendliness,scenarios,and resourcing priority,we don’t support a “simulated” sync call on a background thread.
即UI线程如果被阻塞的话,是不能得到异步响应结果的。关于这个问题,有一个简单的通过WebRequest异步调用的示例如下
另外:一定要同步得到响应的话,可以通过SilverLight调用Javascript实现,在Javascript中使用XMLHttpRequest类即可。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。