And you can download my API wrapper that I wrote in C# here:
http://justinchase.is-a-geek.com/Code/GoogleEngine.zip
It will have some easy to understand examples of how to do the query
and if you're using .NET at all you can just build it as an assembly
and even use it!
~Justin
bye,
lovakumar.
GoogleEngine.Engine TheEngine = new GoogleEngine.Engine();
Then you want to create event handler functions for the various events
the Engine creates:
TheEngine.QueryComplete += new
GoogleEngine.QueryCompleteEventHandler(QueryComplete);
TheEngine.StatusMessage += new
GoogleEngine.Engine.StatusMessageEventHandler(StatusMessage);
To do the query in your Main function:
string query = "joey chandler monica"
TheEngine.Query = query;
TheEngine.DoQuery();
You can also do this in a separate thread (that is why I did it this
way) like this:
Thread t = new Thread(new ThreadStart(QueryComplete));
t.start();
Then Declare the event handler functions:
public void QueryComplete(object o,
GoogleEngine.Engine.QueryCompleteEventArgs e)
{
int rank = TheEngine.Start;
System.Console.WriteLine("Results:");
for(int x=0;rank<e.Result.resultElements.Length;x++)
{
System.Console.WriteLine(Convert.ToString(1+rank++) + ".) " +
e.Result.resultElements[x].URL);
}
}
public void StatusMessage(object o,
GoogleEngine.Engine.StatusMessageEventArgs e)
{
System.Console.WriteLine(e.Message);
}
The spell checking is also the same way pretty much. You also have to
put your key into the engine before you call DoQuery.
You can find other examples and nDoc documentation on my web site at
http://www.d.umn.edu/~chas0084/UROP/
There is also extra support in the library for the built-in language
and location restrictions Google has. Some of the restrictions have
weird codes that are hard to memorize but I created (huge) enumerations
designed for converting Readable country names into the google restrict
codes. That is pretty useful for anyone wishing to search sites from
other countries and in other languages.
Do u have the java code for the C# code u given in the link...
bye.