I have a url like this :
http://www.somesite.com/mypage.aspx?myvalue1=hello&myvalue2=goodbye.
I want to get mypage.aspx?myvalue1=hello&myvalue2=goodbye from it . Can you tell me how can I get it ?
Like this:
new Uri(someString).PathAndQuery
var uri = new Uri("http://www.somesite.com/mypage.aspx?myvalue1=hello&myvalue2=goodbye");
string pathOnly = uri.LocalPath; // "/mypage.aspx"
string queryOnly = uri.Query; // "?myvalue1=hello&myvalue2=goodbye"
string pathAndQuery = uri.PathAndQuery; // "/mypage.aspx?myvalue1=hello&myvalue2=goodbye"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With