从 SilverLight 向本地主机发出 http 请求
我需要创建带有按钮的网页。按下按钮后,我必须从网络服务器获取数据(让我的网页位于 http:// site.com/page.html)并将此数据发送到本地服务器(http://127.0.0.1:31258/)。本地服务器向网页发送响应,并将更改的数据发送到 http://site.com。页面上的这个控件可以用Silverlight来开发,但是以后也必须用html/JavaScript来开发。 我知道浏览器不允许这个技巧,但我必须完成这项工作。 谁能向我展示 Silverlight 中默认 http 请求(并获取响应)的示例以及如何发出跨域请求?我的请求可以称为跨域还是我应该在其他地方寻找解决方案? 我使用 Silverlight v 3.0。 谢谢。
I need to create web-page that has a button. After pressing the button I must get data from the web-server (let my web-page will be located at http://site.com/page.html) and send this data to local server (http://127.0.0.1:31258/). Local server sends response to web-page and changed data is sent to the http://site.com. This control on the page can be developed with Silverlight, but it also must be developed with html/JavaScript in the future.
I know that browser does not allow this trick but I have to make this job done.
Can anyone show me an example of default http request (and getting response) in Silverlight and how to make cross-domain request? Can my request be called as cross-domain or should I look for solution somewhere else?
I use Silverlight v 3.0.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这在 Silverlight 中是可能的,因为您可以将 clientaccesspolicy.xml 文件放入服务器中。请参阅下面的链接
http://msdn。 microsoft.com/en-us/library/cc197955%28v=vs.95%29.aspx
客户端访问策略中的 Intellisense
I think this is possible in Silverlight as you can put the clientaccesspolicy.xml file in your servers. Please see the links below
http://msdn.microsoft.com/en-us/library/cc197955%28v=vs.95%29.aspx
Intellisense in client access policy