我遇到了WebResponse属性的问题,它没有在我的Windows phone7应用程序中正确更新。
ReceiveData() // I m calling this Function recursively, With Timer.
{
strurl = "http://www.***Mylivedatawebsite.com/api/rates.php";
webRequest = (HttpWebRequest)WebRequest.Create(strurl);
webRequest.BeginGetResponse(new AsyncCallback(FinishWebRequest), null);
}
FinishWebRequest(IAsyncResult result)
{
WebResponse resp = webRequest.EndGetResponse(result);
StreamReader objReader = new StreamReader(resp.GetResponseStream());
XDocument Doc = XDocument.Load(objReader);
}解析后单据包含相同的值。请帮帮我。
发布于 2012-09-11 13:39:25
在windows phone7中,webservice响应通常是缓存的。您可以在url的属性中使用增量方法。下面是示例。
static int increment= 0;
strurl = "http://www.***Mylivedatawebsite.com/api/rates.php"+ "id =" + (increment++).ToString();以这种方式,当way服务看到不同的属性id时,它将向服务器发出重新请求。
https://stackoverflow.com/questions/12363141
复制相似问题