我有以下兩個觀測使用改性僅當檢索的XDocument RX +的WebRequest + XDocument.Load
System.Net.WebRequest req = System.Net.HttpWebRequest.Create("http://test.com/data.xml"); req.Method = "HEAD";
var ob = Observable.FromAsyncPattern(req.BeginGetResponse, req.EndGetResponse);
ob().Select(x => x).Select(x => x.Headers["Last-Modified"]).DistinctUntilChanged(x => x);
Observable .Interval(TimeSpan.FromSeconds(1.0)) .Select(_ => XDocument.Load("http://test.com/data.xml"));
我想它可觀察所述的XDocument僅執行時「最後修改」報頭是大於以前所要求的文件有什麼想法?