关于Uri.Segments 属性的理解

public string[] Segments { get; }
Segments 属性返回一个字符串数组,该数组包含构成 URI 的绝对路径的“段”(子字符串)。通过分析绝对路径的第一个字符到斜杠 (/) 或路径末尾,获得第一个段。每个附加段从前一段后的第一个字符开始,到下一个斜杠或路径末尾结束。(URI 的绝对路径包含主机和端口之后、查询和片段之前的所有内容。) 
看不太懂,上例子吧:

 Uri uriAddress1 = new Uri(http://www.contoso.com/title/index.htm);

uriAddress1.Segments[0] /
uriAddress1.Segments[1] title/
uriAddress1.Segments[2] index.htm

看懂了吧!就是以斜杠为单位的段,斜杠属于前面的段。
原文地址:https://www.cnblogs.com/qqhfeng/p/1578617.html