请问如何做像google那样的搜索引擎

解决方案 »

  1.   

    <!-- Search Google -->
    <center>
    <FORM method=GET action="http://www.google.com/search">
    <TABLE bgcolor="#FFFFFF"><tr><td>
    <A HREF="http://www.google.com/intl/zh-CN/">
    <IMG SRC="http://www.google.com/logos/Logo_40wht.gif" 
    border="0" ALT="Google" align="absmiddle"></A>
    <INPUT TYPE=text name=q size=31 maxlength=255 value="">
    <INPUT TYPE=hidden name=hl  value=zh-CN>
    <INPUT type=submit name=btnG  value="Google 搜索">
    </td></tr></TABLE>
    </FORM>
    </center>
    <!-- Search Google -->
      

  2.   

    前段时间我用vc做了个搜索引擎,发布了几个地方了,你google一下“vc搜索引擎”就可以找到源代码了
      

  3.   

    算了吧,类似文章中文的不多,但即使把英文的看完了你也做不下去,涉及到的技术关键字太多。
    我建议你不妨做一个站内的搜索引擎,搜索的原理差不多,要搜全世界,其中的技术问题比前面还要多。html引擎,蜘蛛,忽略词,全文索引
      

  4.   

    private void InitializeComponent()
    {    
    this.TextBox1.TextChanged += new System.EventHandler(this.TextBox1_TextChanged);
    this.ImageButton1.Click += new System.Web.UI.ImageClickEventHandler(this.ImageButton1_Click);
    this.cmdPrev.Click += new System.EventHandler(this.cmdPrev_Click);
    this.cmdNext.Click += new System.EventHandler(this.cmdNext_Click);
    this.Load += new System.EventHandler(this.Page_Load); }
    #endregion void BindList() 
    {
    ICollection collectionSource = this.CreateDataSource();
    PagedDataSource objPds = new PagedDataSource();
    objPds.DataSource = collectionSource;
    objPds.AllowPaging = true;
    objPds.PageSize = 8; objPds.CurrentPageIndex = CurrentPage;  lblCurrentPage.Text = "页次: " + (CurrentPage + 1).ToString() + " of " 
    + objPds.PageCount.ToString(); cmdPrev.Enabled = !objPds.IsFirstPage;
    cmdNext.Enabled = !objPds.IsLastPage; DataList1.DataSource= objPds;
    DataList1.DataBind();
    }
    ICollection CreateDataSource() 
    {
    sKey="R1SnlcZQFHIBYlBCYdip3j1ERCvueU2Z";
    localhost.GoogleSearchService s=new localhost.GoogleSearchService();
    localhost.GoogleSearchResult r=s.doGoogleSearch(sKey, TextBox1.Text, 
    0, 10, true, "", false, "", "", "");
    localhost.ResultElement[] re=r.resultElements;

    DataTable dt = new DataTable();
    DataRow dr; dt.Columns.Add(new DataColumn("title", typeof(string)));
    dt.Columns.Add(new DataColumn("url", typeof(string))); for (int j = 0; j <re.Length; j++) 
    {
    dr = dt.NewRow(); dr[0] = re[j].title;
    dr[1] = re[j].URL; dt.Rows.Add(dr);
    }
    DataView dv = new DataView(dt);
    return dv;
    } public int CurrentPage
    {
    get
    {
    object o = this.ViewState["_CurrentPage"];
    if (o == null)
    return 0;
    else
    return (int) o;
    } set
    {
    this.ViewState["_CurrentPage"] = value;
    }
    } private void cmdPrev_Click(object sender, System.EventArgs e)
    {
    CurrentPage -= 1;
    BindList();
    } private void cmdNext_Click(object sender, System.EventArgs e)
    {
    CurrentPage += 1;
    BindList();
    } private void TextBox1_TextChanged(object sender, System.EventArgs e)
    {

    } private void ImageButton1_Click(object sender, System.Web.UI.ImageClickEventArgs e)
    {

    BindList() ;
    this.cmdNext.Visible=true;
    this.cmdPrev.Visible=true;
    this.lblCurrentPage.Visible=true; }

    }
    }