|
<%@ WebService Language="C#" Class="google" %>
using System;
using System.Collections.Generic;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml;
/// <summary>
/// Summary description for google
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
public class google : System.Web.Services.WebService
{
[WebMethod]
public string[] getList(String prefixText)
{
XmlDocument doc = new XmlDocument();
List<String> suggArList = new List<string>();
string url = "http://google.com/complete/search?output=toolbar&q=" + prefixText;
doc.Load(url);
foreach (XmlNode node in doc.SelectNodes("//CompleteSuggestion"))
{
string value = node.SelectSingleNode("suggestion/@data").InnerText;
suggArList.Add(value);
}
return suggArList.ToArray();
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I am a web developer and working in an Indian Software company having lot of interest in ASP.NET, AJAX, C#. check out http://pabmohan.blogspot.com