C# 如何使用非祖先引用解析url
我的URL引用的文件夹不是指向页面的直接祖先-如下所示:C# 如何使用非祖先引用解析url,c#,url,C#,Url,我的URL引用的文件夹不是指向页面的直接祖先-如下所示: http://www.mysite.com/home/../help/helppage.aspx http://www.mysite.com/contact/../help/helppage.aspx http://www.mysite.com/accounts/performing-accounts/../../help/helppage.aspx 我希望能够毫不含糊地解决这些问题 我如何在C#中做到这一
http://www.mysite.com/home/../help/helppage.aspx
http://www.mysite.com/contact/../help/helppage.aspx
http://www.mysite.com/accounts/performing-accounts/../../help/helppage.aspx
我希望能够毫不含糊地解决这些问题
我如何在C#中做到这一点?Uri=newuri(“http://www.mysite.com/home/../help/helppage.aspx");
uri.AbsoluteUri;//请看这个:
Uri uri = new Uri("http://www.mysite.com/home/../help/helppage.aspx");
uri.AbsoluteUri; // <- Contains http://www.mysite.com/help/helppage.aspx