SitemapNode
Represents a page or URL in your sitemap.
构造函数
public SitemapNode(string url)
sitemapNode = SitemapNode(url)
Initializes a new instance of the SitemapNode class.
- url
- The URL of the page.
属性
public XhtmlLinkCollection AlternateLinks { get; }
value = sitemapNode.AlternateLinks
Gets the collection of alternate language links for this page. Used to specify alternate language versions of the same content for multilingual websites. These links will be rendered as <xhtml:link> elements in the sitemap XML.
public SitemapFrequency? Frequency { get; set; }
value = sitemapNode.Frequency
sitemapNode.Frequency = value
Gets or sets how frequently the page is likely to change. This value provides general information to search engines and may not correlate exactly to how often they crawl the page. Please note that this value is considered a hint and not a command. Even though search engine crawlers may consider this information when making decisions, they may crawl pages marked "hourly" less frequently than that, and they may crawl pages marked "yearly" more frequently than that. Crawlers may periodically crawl pages marked "never" so that they can handle unexpected changes to those pages.
public DateTime? LastModified { get; set; }
value = sitemapNode.LastModified
sitemapNode.LastModified = value
Gets or sets the date of last modification of the file. This is an optional field. You may omit the time portion if desired. Note that this is separate from the If-Modified-Since (304) HTTP header the server can return, and search engines may use the information from both sources differently.
public double? Priority { get; set; }
value = sitemapNode.Priority
sitemapNode.Priority = value
Gets or sets the priority of this URL relative to other URLs on your site. Valid values range from 0.0 to 1.0. This field is optional, if it is null the default priority of a page is 0.5. This value does not affect how your pages are compared to pages on other sites, it only lets the search engines know which pages you deem most important for the crawlers. Please note that the priority you assign to a page is not likely to influence the position of your URLs in a search engine's result pages. Search engines may use this information when selecting between URLs on the same site, so you can use this tag to increase the likelihood that your most important pages are present in a search index. Also, please note that assigning a high priority to all of the URLs on your site is not likely to help you. Since the priority is relative, it is only used to select between URLs on your site.
public string Url { get; }
value = sitemapNode.Url
Gets or sets the URL of the page. This URL must begin with the protocol (such as http) and end with a trailing slash, if your web server requires it. This value must be less than 2,048 characters.
方法
public override string ToString()
result = sitemapNode.ToString()
Returns a String that represents the current Object.
返回值: A String that represents the current Object.