string convertion!!need help

bhavin12300

Active member
Joined
Sep 18, 2007
Messages
44
Programming Experience
Beginner
hi
i have following link with querystring in it.
i want to get the value of variable "media " from it
VB.NET:
http://abc.com/mediadetail/?media=http%3A%2F%2Fi282.photobucket.com%2Falbums%2Fkk241%2Fmacylynn00 %2Fcar.jpg&searchTerm=car&pageOffset=0"

and also as you can see that "http://" is converted to "http%3A%2F%2F"
how to get it back to "http://" means valid string.
can you tell me how to do that?
is there any function from which i can get it directly
 
On the string do a replace:

VB.NET:
YourString = YourString.Replace("%3A", ":").Replace("%2F", "/")
 
VB.NET:
Dim link As String = "http://abc.com/mediadetail/?media=http%3A%2F%2Fi282.photobucket.com%2Falbums%2Fkk241%2Fmacylynn00%2Fcar.jpg&searchTerm=car&pageOffset=0"
Dim u As New Uri(link)
Dim q As String = u.Query.Substring(1)
q = System.Web.HttpUtility.HtmlDecode(q)
Dim media As String = System.Web.HttpUtility.ParseQueryString(q).Item("media")
 
thanks johnh
thats the one what i was in need.as i am new in .net dont know abt this class thanks.
thanks JuggaloBrotha too
its also easy solution
thanks you so much community
 
Back
Top