var
  Count : Integer;
  Input: TStrings;
Begin
  Input:=nil;
  Case request.methodtype of
   mtpost: Input := request.ContentFields;
   mtget,mtput,mthead: Input := request.QueryFields;
  end;
  if input.values['materialid']<>'' then
  begin
   try
     response.content:=
     '<HTML><HEAD><TITLE>查询结果</TITLE></HEAD>'#13+'<BODY>'#13+
      '<H2><font face="隶书" color="green" >查询结果信息:</font></H2>'#13+
      '<table border="1" width="100%" bordercolorlight="#FFFFFF" bordercolordark="#808080" bordercolor="#000000" align="left" cellspacing="1">'#13+'<tr>'#13+
      '<td width="25%" height="16" align="center"><font color="#0000FF"><b>档案编号</b></font></td>'#13+
      '<td width="25%" height="16" align="center"><font color="#0000FF"><b>档案名称</b></font></td>'#13+
      '<td width="15%" height="16" align="center"><font color="#0000FF"><b>图    号</b></font></td>'#13+
      '<td width="35%" height="16" align="center"><font color="#0000FF"><b>图纸路径</b></font></td>'#13+
       '<tr>'#13;  //#13是换行符
     query.sql.clear;
     query.sql.add('select * from Com_material '+'where (materialid like "%'+input.values['materialid']+'%")');
     query.open;
     query.first;
     Count:= 0;
     while not Query.eof do
     begin
      response.content:=response.content+'<tr>'#13+
     '<td width="25%" height="16" align="center">'+Query.FieldByName('materialid').AsString+'</td>'#13+
     '<td width="25%" height="16" align="center">'+Query.FieldByName('materialname').AsString+'</td>'#13+
     '<td width="15%" height="16" align="center">'+Query.FieldByName('specs').AsString+'</td>'#13+
     '<td width="35%" height="16" align="center">'+Query.FieldByName('pathway').AsString+'</td>'#13+
     '<tr>'#13;
      count:=count+1;
      Query.Next;
     end;
     response.content:=response.content+'共查询到'+inttostr(count)+'条信息<br>';
   finally
     response.content:=response.content+'</table></BODY ></HTML>';
   end;
  end 
  else response.content:='请先输入标题关键词:';
end;