0

我有这个服务器端代码:

<?php
header('Content-Type: text/xml');
?>
<?xml version="1.0" encoding="utf-8" ?>
<Data>
<Entry> <?php echo time(); ?> </Entry>
</Data>

这在 Windows Phone 应用程序上:

Imports System.Xml.Linq
Partial Public Class MainPage
    Inherits PhoneApplicationPage
    Public Sub New()
        InitializeComponent()
    End Sub
    Private Sub cl_DownloadStringCompleted(sender As Object, e As System.Net.DownloadStringCompletedEventArgs)
        Dim doc = XDocument.Parse(e.Result)
        TextBox1.Text = doc.<Data>.<Entry>.Value
    End Sub

    Private Sub Button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click
        Dim cl As New WebClient
        AddHandler cl.DownloadStringCompleted, AddressOf cl_DownloadStringCompleted
        cl.DownloadStringAsync(New Uri("http://localhost/wp/helloworld.php"))
    End Sub
End Class

但这是我的问题:它不会改变值!它一直显示相同的东西!它一定是类似于缓存内存的东西......(?)

有任何想法吗 ?

4

1 回答 1

1

尝试在您的请求中添加一些虚假数据:

cl.DownloadStringAsync(New Uri("http://localhost/wp/helloworld.php?" + "fake="+DateTime.Now.Ticks));

这是一种欺骗操作系统缓存系统的方法。

而且您不需要fake在服务器端解析参数。

于 2012-09-06T15:37:56.007 回答