I encrypt the entire query string on one page, and then decrypt it on another. I get a NameValueCollection of all values ββusing HttpUtility.ParseQueryString.
Now I have a class whose properties match the string character names of the request. I am trying to set the value of properties from a query string.
Here is my code:
NameValueCollection col = HttpUtility.ParseQueryString(decodedString); ConfirmationPage cp = new ConfirmationPage(); for(int i = 0; i < col.Count; i++) { Type type = typeof(ConfirmationPage); FieldInfo fi = type.GetField(col.GetKey(i)); }
I see patterns of extracting values ββthrough reflection - but I would like to get a link to the property of the ConfirmationPage class and set it with its value in the loop - col.Get (i).
source share