7developers blog

Useful articles, videos and code examples from professional developers

C # Get access to private class members using Reflection


Type type = Request.GetType();
PropertyInfo property = type.GetProperty("QueryStringBytes",
BindingFlags.Instance | BindingFlags.IgnoreCase | BindingFlags.NonPublic);
byte[] queryBytes = (byte[])property.GetValue(Request, null);
string querystring = HttpUtility.UrlDecode(queryBytes, Encoding.UTF8);


Loading