引入服务地址后
try
   {
    GoogleServer.GoogleSearchResult r = s.doGoogleSearch("lIpbg1NQFHJxa59bxq5SqMuiN6hHs0Ef",TextBox1.Text,0,10,false,"",false,"","","");
    int count = r.estimatedTotalResultsCount;
    Label2.Text = "搜索关键字名为“" + TextBox1.Text + "”的总记录数为" + count.ToString() + "条!";
    ArrayList al = new ArrayList();
    string temp = "";
    for( int i = 0; i< r.resultElements.Length; i++ )
    {
     temp = "<a href=\"" + r.resultElements[i].URL + "\">" + r.resultElements[i].title + "</a>";
     al.Add(temp);
    }
    this.DataGrid1.DataSource = al;
    this.DataGrid1.DataBind();
   }
   catch(Exception ex)
   {
    Label2.Text = "错误:" + ex.Message.ToString();
   }
Posted on 2006-06-17 13:17  李通通  阅读(299)  评论(0编辑  收藏  举报