Upac.GoogleSiteSearch.GoogleSiteSearch.FormatQueryString C# (CSharp) 메소드

FormatQueryString() 보호된 메소드

Formats the query string.
protected FormatQueryString ( string cx, string query, string start, string pageSize, string site ) : string
cx string The cx.
query string The query.
start string The start.
pageSize string Size of the page.
site string
리턴 string
        protected virtual string FormatQueryString(string cx, string query, string start, string pageSize, string site)
        {
            if (!string.IsNullOrEmpty(site))
            {
                query = string.Format("{0} site:{1}", query, site);
            }

            string url = string.Format(_googleBaseUrl + "?cx={0}&client=google-csbe&q={1}&output=xml_no_dtd", cx, query);

            if (string.IsNullOrEmpty(pageSize))
            {
                pageSize = "10";
            }

            if (!string.IsNullOrEmpty(start))
            {
                url += "&start=" + start;
            }

            if (!string.IsNullOrEmpty(pageSize))
            {
                url += "&num=" + pageSize;
            }

            return url;
        }