????? ??????? ??? ??????? ASP.NET ??? ??????? ???? ????? "???? ???????" ???????? Visual C# .NET

?????? ????????? ?????? ?????????
???? ???????: 820983 - ??? ???????? ???? ????? ????? ??? ???????.
?????? ??? ????? Microsoft Visual Basic .NET ?? ??? ???????? ???? 820105.
????? ???? | ?? ????

?? ??? ??????

??????

???? ??? ??????? ???? ????? ??? ????? ????? ???? ????? "???? ???????". ???? ??? ??????? ????? ????? ??????? ??? ASP.NET ????????? ??????? ??????? "???? ???????" ???????.

????? ???? ????????

  1. ????? ???? ???? ??? ???? ??????? C ?? ???? ????????? ????? ??. ??? ?????? myCatalogFolder.
  2. ??? ????? ???? ?? ??? ??????? ?? ?? ???? ???? ?????? ?? ????? ????:
    ??? ?? ??????? ???????? ??????? ????????? ???? ?????? ? ??? ????? ??? ?? IndexText.text.
  3. ?? ???? ????? ???? C:\myCatalogFolder\IndexText.txt.

????? ???? ????? "???? ???????"

  1. ???? ??? ???? ?? ???? ??? ????? ????? compmgmt.msc ?? ???? ??? ?????.
  2. ?? ?????? ??????? ??????????.
  3. ???? ??? ?????? ?????? ??? ???? ??????? ? ??? ??? ???? ?? ???? ??? ??????.
  4. ?? ???? ???? ????? ? ???? TestCatalog.
  5. ???? ??? ??????? ???? ???? ?????? ??? ???? ??? ?????? ??????? ?? ???? ??? ????? ?????.
  6. ??? "?????? ????" ??????? ? ????? ??????? ???????:
    ????? ??? ????? ?????? ??? ????? ????? "???? ???????"
    ???? ??? ?????.
  7. ???? ??? ?????? ?????? ??? ???? ??????? ??? ?? ???? ??? "?????" ?????? "???? ???????".
  8. ???? ??? ?????? ?????? ??? ???? ??????? ??? ?? ???? ??? "????" ??? ????? ????? "???? ???????".

????? ???? ?????? ???????

??? ????? ?????? ???? ????? ???????? ???? ???? ??????? ?? ???? ?????? ???????. ?????? ?? ???????? ?? ???????? ???? ??? ??????? ?? ?????? ??????? ??????? ?? ?????? ???????. ????? ?????? ??????? ???? ??? ?????? ?? ?????? ? ??????? ?? ??????. ??? ???? ????? ?? ??????? ???? ??????? ??????? ??? ????? ????? ?? ???????.
  1. ???? ????? ??????? ??? TestCatalog (???????? ???? ??? ??????? ?? ??? "????? ???? ??????").
  2. ???? ??? ?????? ?????? ??? ??????? ? ??? ??? ???? ?? ???? ??? ????.
  3. ???? ??? ??????? ? ??? ???? ??? ?? ???? ??? ?????? ???? ???? ????? (C:\myCatalogFolder\) ?? ???? ??? ?????.

    ?????? ??? ????? ?? ??????? ? ? ???? ??? ???.

????? ????? ??? ASP.NET

  1. ??? ????? Microsoft Visual Studio .NET.
  2. ?????? Visual C# .NET ?????? ???? ??? ASP.NET ??????? ???????. ??? ??????? IndexQueryApp. ?????????? ??? ????? WebForm1.aspx.
  3. ?? ????? ????? "?????" ? ???? ??? ?????? ?????? ??? WebForm1 ??? ?? ???? ??? ??? ???? HTML.
  4. Replace the existing HTML code with following sample code:
    <%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="IndexQueryApp.WebForm1" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
       <HEAD>
          <title>WebForm3</title>
          <meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
          <meta name="CODE_LANGUAGE" Content="C#">
          <meta name="vs_defaultClientScript" content="JavaScript">
          <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
       </HEAD>
       <body MS_POSITIONING="GridLayout">
          <form id="WebForm3" method="post" runat="server">
             <asp:TextBox id="TextBox1" style="Z-INDEX: 101; LEFT: 90px; POSITION: absolute; TOP: 136px" runat="server"></asp:TextBox>
             <asp:DataGrid id="DataGrid1" style="Z-INDEX: 102; LEFT: 328px; POSITION: absolute; TOP: 138px" runat="server"></asp:DataGrid>
             <asp:Button id="Button1" style="Z-INDEX: 103; LEFT: 92px; POSITION: absolute; TOP: 199px" runat="server" Text="Button"></asp:Button>
          </form>
       </body>
    </HTML>
  5. ?? "?????? ??????" ???? ??? ?????? ?????? ??? WebForm1 ??? ?? ???? ??? ??? ????????? ????????. ??????? ????????? ???????? ???????? ?? ????? ????????? ???????? ??????:
    using System;
    using System.Data;
    
    namespace IndexQueryApp
    {
       public class WebForm1 : System.Web.UI.Page
       {
          protected System.Web.UI.WebControls.TextBox TextBox1;
          protected System.Web.UI.WebControls.DataGrid DataGrid1;
          protected System.Web.UI.WebControls.Button Button1;
       
    		private void Page_Load(object sender, System.EventArgs e)
    		{
    			// Put user code to initialize the page here.
    		}
    
    		#region Web Form Designer generated code
    		override protected void OnInit(EventArgs e)
    		{
    			//
    			// CODEGEN: The ASP.NET Web Form Designer requires this call.
    			//
    			InitializeComponent();
    			base.OnInit(e);
    		}
    		
    		/// <summary>
    		/// Required method for Designer support - do not modify
    		/// the contents of this method by using the code editor.
    		/// </summary>
    		private void InitializeComponent()
    		{     
                                 this.Button1.Click += new System.EventHandler(this.Button1_Click);
                                 this.Load += new System.EventHandler(this.Page_Load);
                              }
    		#endregion
    
          private void Button1_Click(object sender, System.EventArgs e)
          {
             // Catalog Name
             string strCatalog = "TestCatalog";
             string strQuery="";
    
             strQuery = "Select DocTitle,Filename,Size,PATH,URL from Scope()  where FREETEXT('" +TextBox1.Text+ "')";
              // TextBox1.Text is the word that you type in the text box to query by using Indexing Service.
    
             string connstring = "Provider=MSIDXS.1;Integrated Security .='';Data Source="+strCatalog;
    
             System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(connstring);      
             conn.Open();
    
             System.Data.OleDb.OleDbDataAdapter cmd = new System.Data.OleDb.OleDbDataAdapter(strQuery, conn);
    		
             System.Data.DataSet testDataSet = new System.Data.DataSet();
    		
             cmd.Fill(testDataSet, "SearchResults");
             DataView source = new DataView(testDataSet.Tables[0]);
             DataGrid1.DataSource = source;
             DataGrid1.DataBind();
          }     
      }
    }
    
  6. ?? ??????? ????? ? ???? ??? ???? ????.

????? ???????

  1. ?? ??????? ????? ? ???? ??? "????" ?????? ???????.
  2. ???? ???? ????????? ??????? ?? ???? ????. (????? ????? ?? ???? ?? ??? IndexText.txt.)
  3. ???? ??? ??. ????? ???? ?????? ????? ????????? ?? IndexText.txt ???? ?????? ?????.

??????? ????? ????????

????? ??? ??? ???? ??????

???? ??????? ???????? ?????? TestCatalog ?? ?????? ????? ??????? ???????. ??? ????? ????? ???????? ???????? ?? ?? ????? ??????? ???? ???? ??? ?? ????? ??? "???? ???????" ????? ??? ????? ?????? ??????.

?????? ?? ???? ?????? ??? ???? ???? ?????? ???????? MMC ????? ????????? ?? "???? ???????" ?? ????? ??????? ?? ???? ?? ?? ???? ????? ??????? TestCatalog ???? ?? ?????. ??? ??? Word ????? ?????? ?? ???, ???????? ????? ????? ???????.

?? ???? ???????? ??????

??? ?? ??? ????? ????? ????? ??????? ??? ????????? ??????, ?????? ?????? ?? ???? ???? ????. ???????? ??? ??????? ?????? ?? ?? ?????? ????? "???? ???????" ?????? ???? ????????? ??? ????. ?????? ????? ???? ??????? ???????:
  1. ???? ??? ???? ? ???? ??? ??????? ?? ???? ??? ???? ??????.
  2. ???? ????? ??????? ??? ????? ?????? ?? ???? ????? ??????? ??? ????? ?????????.
  3. ?? ???? ???? ??????? ???? ????? ??????? ??? ??????? ??????????.
  4. ???? ??? ?????? ?????? ??? ???? ??????? ??? ?? ???? ??? ?????.
  5. ???? ??? ?????? ?????? ??? ???? ??????? ??? ???? ?? ???? ??? ????.

?????

????? ?? ????????? ??? "???? ???????" ?? ?????? ???? Microsoft ?????? ??? ?????:
http://msdn2.microsoft.com/en-us/library/ms689644.aspx
????? ?? ?????????? ???? ??? ????? ???????? ??????? ?????? ?? "????? ??????? ?? Microsoft:
311521????? ????? ????? ASP.NET ?? ???? ??????? Microsoft Server ??????
????? ?? ?????????? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
308202????? ????? ???? ????? ??????? ???????


???????

???? ???????: 820983 - ????? ??? ??????: 22/?? ?????/1427 - ??????: 3.4
????? ???
  • Microsoft ASP.NET 1.1
  • Microsoft ASP.NET 1.0
  • Microsoft Visual C# .NET 2003 Standard Edition
  • Microsoft Visual C# .NET 2002 Standard Edition
  • Microsoft Windows Indexing Service 2.0
????? ??????: 
kbmt kbquery kbservice kbdatabinding kbdataadapter kbwebserver kbwebforms kbhowtomaster KB820983 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????820983

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com