Get id from ResponseUri in C #

I want to get id from ResponseUri.

I have the following URL

http://site5.way2sms.com/Main.action;jsessionid=77C20044847CD2C97BA89217A4D040A8.w803?id=77C20044847CD2C97BA89217A4D040A8.w803

I want to get the id from the line above. How can i do this?

+4
source share
2 answers
string iduri = System.Web.HttpUtility.ParseQueryString(res.ResponseUri.Query).Get("id"); 

use this

+1
source
 Uri uUri = new Uri("http://site5.way2sms.com/Main.action;jsessionid=77C20044847CD2C97BA89217A4D040A8.w803?id=77C20044847CD2C97BA89217A4D040A8.w803"); string strId = System.Web.HttpUtility.ParseQueryString(uUri.Query).Get("id"); 
+3
source

Source: https://habr.com/ru/post/1433118/


All Articles