C# 在webclient windows phone和webservice之间同步数据

C# 在webclient windows phone和webservice之间同步数据,c#,windows-phone-7,windows-phone-8,webclient,C#,Windows Phone 7,Windows Phone 8,Webclient,我在windows phone 8应用程序上使用webclient,我必须每分钟(或按一个按钮)与webservice同步一些数据。我将我的webclient放在我的对象的私有数据中: private WebClient client_summary; 启动应用程序时,客户端将连接到Web服务: client_summary = new WebClient(); client_summary.DownloadStringAsync(new Uri("random url" + info_con

我在windows phone 8应用程序上使用webclient,我必须每分钟(或按一个按钮)与webservice同步一些数据。我将我的webclient放在我的对象的私有数据中:

private WebClient client_summary;
启动应用程序时,客户端将连接到Web服务:

client_summary = new WebClient();
client_summary.DownloadStringAsync(new Uri("random url" + info_conf.id));
client_sommaire.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadSummaryConf);
我很好地恢复了数据,但每次我想重新同步我的webclient时,数据都保持不变:(

e、 结果保持不变,但如果我重新启动应用程序,数据将正确同步 我不明白为什么同步不起作用。。。
请提前告诉我谢谢。

这是一个缓存问题-Webclient类(如果您选择使用该类,HttpClient类)缓存服务器响应。标准的解决方法是在查询字符串中添加不同的内容

有关示例,请参见:

DispatcherTimer TradeThread = new DispatcherTimer();
TradeThread.Interval = TimeSpan.FromSeconds(10);
TradeThread.Tick += new EventHandler(dispatcherTimer_Tick);
TradeThread.Start();

private void dispatcherTimer_Tick(object sender, EventArgs e)
    {


        pivotMainList.Items.Clear();           

        summary.Children.Clear();
        client_summary.DownloadStringAsync(new Uri("url" + info_conf.id));


    }
private void client_DownloadSummaryConf(object sender, DownloadStringCompletedEventArgs e)
    {
        MessageBox.Show(e.Result); 
    }