This documentation is archived and is not being maintained.

Uri.Query Property

Gets any query information included in the specified URI.

Namespace: System
Assembly: System (in system.dll)

public string Query { get; }
/** @property */
public String get_Query ()

public function get Query () : String

Property Value

A String containing any query information included in the specified URI.

The Query property contains any query information included in the URI. Query information is separated from the path information by a question mark (?) and continues to the end of the URI. The query information returned includes the leading question mark.

The query information is escaped according to RFC 2396.

The following example writes the query ?date= today to the console.

Uri baseUri = new Uri ("");
Uri myUri = new Uri (baseUri, "catalog/shownew.htm?date=today");

Console.WriteLine (myUri.Query);

Uri baseUri = new Uri("");
Uri myUri = new Uri(baseUri, "catalog/shownew.htm?date=today");

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0