Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

UriExtensions.TryReadQueryAs Method (Uri, Type, Object%)

Reads HTML form URL encoded data provided in the URI query string as an object of a specified type.

Namespace:  System.Net.Http
Assembly:  System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)

public static bool TryReadQueryAs(
	this Uri address,
	Type type,
	out Object value


Type: System.Uri
The URI to read.
Type: System.Type
The type of object to read.
Type: System.Object%
When this method returns, contains an object that is initialized from the query component of the URI. This parameter is treated as uninitialized.

Return Value

Type: System.Boolean
true if the query component of the URI can be read as the specified type; otherwise, false.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Uri. When you use instance method syntax to call this method, omit the first parameter. For more information, see https://msdn.microsoft.com/en-us/library/bb384936(v=vs.108).aspx or https://msdn.microsoft.com/en-us/library/bb383977(v=vs.108).aspx.
© 2015 Microsoft