Gets or sets any query information included in the URI. : UriBuilder « Network « C# / C Sharp






Gets or sets any query information included in the URI.

 
using System;

public class MainClass
{
    public static void Main()
    {
        UriBuilder baseUri = new UriBuilder("http://www.google.com/default.aspx?Param1=7890");
        string queryToAppend = "param2=1234";

        if (baseUri.Query != null && baseUri.Query.Length > 1)
            baseUri.Query = baseUri.Query.Substring(1) + "&" + queryToAppend;
        else
            baseUri.Query = queryToAppend;



    }
}

   
  








Related examples in the same category

1.Initializes a new instance of the UriBuilder class with the specified scheme and host.
2.Initializes a new instance of the UriBuilder class with the specified scheme, host, and port.
3.Initializes a new instance of the UriBuilder class with the specified scheme, host, port number, and path.
4.Initializes a new instance of the UriBuilder class with the specified scheme, host, port number, path and query string or fragment identifier.
5.Gets or sets the fragment portion of the URI.