WebClient 下载奇怪的行为 [英] WebClient download weird behavior

查看:31
本文介绍了WebClient 下载奇怪的行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 Web 客户端似乎有这种奇怪的行为我的应用程序适用于这种情况:
1 用户浏览主题及其回复(使用 URL 和 DownloadStringAsync 从网络加载)
2-他在主题中添加回复
3- 我再次从网上重新加载评论的回复

It seems that i have this weird behavior in my Web Client My application goes in this scenario:
1-user browse topics and it's replies (Loaded from the web using URL & DownloadStringAsync)
2-he add a reply in the topic
3- I re-load the replies of the comment again from the web

但是新添加的回复虽然在网页上查看URL时会出现,但在新下载的结果上却没有出现,只有在关闭应用程序并重新打开时才会出现回复.

But the new added reply don't appear on the new downloaded result although it appears when viewing the URL on the Web , The reply appears only if the application is closes and re-opened.

我想在用户发布后立即查看页面中的回复

I want to view the reply in the page as soon the user post it

推荐答案

WebClient 在 Windows Phone 上缓存 URL(和响应).*您可以:

WebClient caches urls (and responses) on Windows Phone.* You could:

  • 每次发送不同的网址.在 url 上添加一个虚假的搜索项,如 ?phonyid=1 并每次递增.
  • 在服务器上的 url 页面上指定不允许浏览器缓存.

*我对这种行为的第一个参考是 Timdam 在 http://goo.gl/nqs27 的博客条目,但我在实践中也看到过这种情况.

*my first reference for this behavior is Timdam's blog entry at http://goo.gl/nqs27, but I've also seen this happen in practice.

这篇关于WebClient 下载奇怪的行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆