你好,我有这样的应用程序,阅读7小xml和存储结果,但因为现在它甚至下载的一切时,XML文件是不变。
我很想去检查,如果XML是新的或已被修改,但我不能找到一个解决办法,也许这是一个简单的,我想在困难的方式来实现这一目标
谁能帮助吗?
由于在咨询:)
这里是我的ATM代码:
WebClient downloader = new WebClient();
downloader.DownloadStringAsync(new Uri("http://feeds.feedburner.com/bluey/eventi20" + "?" + System.DateTime.Now.ToString(), UriKind.RelativeOrAbsolute));
downloader.DownloadStringCompleted += new DownloadStringCompletedEventHandler(EventiDownloaded);
我试图寻找lastmodify,或者说我能以这种方式使用,在XML的头
WebClient downloader = new WebClient();
downloader.DownloadStringAsync(new Uri("http://feeds.feedburner.com/bluey/eventi20" + "?" + System.DateTime.Now.ToString(), UriKind.RelativeOrAbsolute));
downloader.DownloadStringCompleted += new DownloadStringCompletedEventHandler(EventiDownloaded);
WebHeaderCollection myWebHeaderCollection = downloader.ResponseHeaders;
foreach(var x in myWebHeaderCollection)
for (int i = 0; i < myWebHeaderCollection.Count; i++)
MessageBox.Show("\t" + myWebHeaderCollection.AllKeys.GetEnumerator() + " = " + myWebHeaderCollection.AllKeys.ElementAt(i));
但我得到了myWebHeaderCollection空引用错误