共用方式為


AtomPubClient.RetrieveFeedAsync(Uri) 方法

定義

啟動異步操作,以從指定的 URI 下載新聞訂閱摘要。 這個方法會從摘要字串具現化 SyndicationFeed 物件,其格式可以是 SyndicationFormat 中指定的其中一種格式。

public:
 virtual IAsyncOperationWithProgress<SyndicationFeed ^, RetrievalProgress> ^ RetrieveFeedAsync(Uri ^ uri) = RetrieveFeedAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperationWithProgress<SyndicationFeed, RetrievalProgress> RetrieveFeedAsync(Uri const& uri);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperationWithProgress<SyndicationFeed,RetrievalProgress> RetrieveFeedAsync(System.Uri uri);
function retrieveFeedAsync(uri)
Public Function RetrieveFeedAsync (uri As Uri) As IAsyncOperationWithProgress(Of SyndicationFeed, RetrievalProgress)

參數

uri
Uri Uri

從中下載摘要的 URI。

傳回

包含作業的結果。

實作

M:Windows.Web.Syndication.ISyndicationClient.RetrieveFeedAsync(Windows.Foundation.Uri) M:Windows.Web.Syndication.ISyndicationClient.RetrieveFeedAsync(System.Uri)
屬性

範例

下列程式代碼示範如何使用 AtomPubClient 在特定服務位址擷取摘要。 如需如何使用 AtomPub 來管理摘要內容的其他範例,請下載 AtomPub 範例

function retieveFeed() {
    try {
        // Refresh client in case server url or credential have changed.
        createClient();

        // Note that this feed is public by default and will not require authentication.
        // We will only get back a limited use feed, without information about editing.
        var resourceUri = new Windows.Foundation.Uri(document.getElementById("serviceAddressField").value.trim() + defaultFeedUri);

        outputField.innerHTML = "Fetching resource: " + resourceUri.absoluteUri + "/br";
        client.retrieveFeedAsync(resourceUri).done(function (feed) {
            currentFeed = feed;
            currentItemIndex = 0;

            outputField.innerHTML += "Complete</br>";
            displayCurrentItem();
        }, onError);
    }
    catch (ex) {
        outputField.innerHTML += "Exception:" + ex + "</br>";
    }
}

適用於

另請參閱