user1044220
user1044220

Reputation: 371

Get values from string in querystring format vb.net

I'm new to asp.net/vb.net. I have a string that is in querystring format, that is the string is formatted: value1=data1&value2=data2...

I need a way (i'm sure theirs probably a built in function for it) to be able to get the value for any given field such as Dim data1 = string.querystring("value1"). I googlged it and found the function querystring but it only seems to work on getting straight from a URL, but I have that data stored in a string variable and want to get the data from this. Is this possible?

Upvotes: 0

Views: 3679

Answers (1)

Wiktor Zychla
Wiktor Zychla

Reputation: 48230

HttpUtility.ParseQueryString, you can call it in any context as it just expects string parameter. Just add a reference to System.Web, you can do it even it desktop apps.

http://msdn.microsoft.com/en-us/library/ms150046.aspx

Upvotes: 3

Related Questions