SyndicationLink.CreateAlternateLink 方法

定义

创建一个新的 SyndicationLink 对象。Creates a new SyndicationLink object.

重载

CreateAlternateLink(Uri)

使用指定的 SyndicationLink 创建新的 Uri 对象。Creates a new SyndicationLink object with the specified Uri.

CreateAlternateLink(Uri, String)

使用指定的 SyndicationLink 和媒体类型创建新的 Uri 对象。Creates a new SyndicationLink object with the specified Uri and media type.

注解

此方法会创建新的 SyndicationLink 对象并将 RelationshipType 设置为 alternateThis method creates a new SyndicationLink object and sets RelationshipType to alternate.

使用指定的 SyndicationLink 创建新的 Uri 对象。Creates a new SyndicationLink object with the specified Uri.

public:
 static System::ServiceModel::Syndication::SyndicationLink ^ CreateAlternateLink(Uri ^ uri);
public static System.ServiceModel.Syndication.SyndicationLink CreateAlternateLink (Uri uri);
static member CreateAlternateLink : Uri -> System.ServiceModel.Syndication.SyndicationLink
Public Shared Function CreateAlternateLink (uri As Uri) As SyndicationLink

参数

uri
Uri

链接资源的 URI。The URI of the linked resource.

返回

SyndicationLink

SyndicationLink 实例。A new SyndicationLink instance.

示例

下面的示例演示如何创建一个替代链接。The following example shows how to create an alternate link.

SyndicationLink link = SyndicationLink.CreateAlternateLink(new Uri("http://server/link"));
Dim link As SyndicationLink = SyndicationLink.CreateAlternateLink(New Uri("http://server/link"))

适用于

使用指定的 SyndicationLink 和媒体类型创建新的 Uri 对象。Creates a new SyndicationLink object with the specified Uri and media type.

public:
 static System::ServiceModel::Syndication::SyndicationLink ^ CreateAlternateLink(Uri ^ uri, System::String ^ mediaType);
public static System.ServiceModel.Syndication.SyndicationLink CreateAlternateLink (Uri uri, string mediaType);
static member CreateAlternateLink : Uri * string -> System.ServiceModel.Syndication.SyndicationLink
Public Shared Function CreateAlternateLink (uri As Uri, mediaType As String) As SyndicationLink

参数

uri
Uri

链接资源的 URI。The URI of the linked resource.

mediaType
String

链接的媒体类型。The media type of the link.

返回

SyndicationLink

SyndicationLink 实例。A new SyndicationLink instance.

示例

下面的示例演示如何创建一个替代链接。The following example shows how to create an alternate link.

SyndicationLink link = SyndicationLink.CreateAlternateLink(new Uri("http://server/link"), "text/html");
Dim link As SyndicationLink = SyndicationLink.CreateAlternateLink(New Uri("http://server/link"), "text/html")

适用于