ASP.NET 取得 Uri 各项属性值

Uri uri = new Uri("http://www.yoercn.com/aboutus/idea.html");
string Host = uri.Host;                             //www.yoercn.com
string AbsolutePath = uri.AbsolutePath;     //aboutus/idea.html
string AbsoluteUri = uri.AbsoluteUri;          //http://www.yoercn.com/aboutus/idea.html
string Authority = uri.Authority;                //www.yoercn.com
string DnsSafeHost = uri.DnsSafeHost;      //www.yoercn.com
string LocalPath = uri.LocalPath;                //aboutus/idea.html
string OriginalString = uri.OriginalString;    //http://www.yoercn.com/aboutus/idea.html
string PathAndQuery = uri.PathAndQuery;  //aboutus/idea.html
string Scheme = uri.Scheme;                    //http

编程不是为了生存,更多的是乐趣和成就感~
原文地址:https://www.cnblogs.com/dckhello/p/5583333.html