我有几个ASPX的页面,其实也没做多少事,但是在跳转到另外一个ASPX页面时,响应好慢好慢,程序上也没做多大的事儿啊,这个跟应用程序池有关系么?大家伙有碰到这事儿么???下面是一小段相关的主要的代码之一:
--------------------------------------------------------------------------------
IndexSearcher searcher = new IndexSearcher(Tools.IndexPath);
Lucene.Net.Analysis.Standard.StandardAnalyzer analyzer = new Lucene.Net.Analysis.Standard.StandardAnalyzer();
Query query = QueryParser.Parse(key,"title",analyzer);
Hits hits = searcher.Search(query);
records = hits.Length();
float timeSpan = (System.DateTime.Now.Ticks - time) / System.TimeSpan.TicksPerMillisecond / 1000f;
TxtInfo.Text = "<span>搜索的<font color=\"#ff0000\">" + Server.HtmlEncode(key) + "</font>结果共" + records + "项,总耗时" + timeSpan + "秒.</span>";
pages = Tools.Ceil(records / 20d);
page = page > pages ? pages : page;
page = page < 1 ? 1 : page;
string[] bgcolors = new string[]{"#f4f7fd","#ffffff"};
RsTable = "\n<table border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">";
int i = 0,l = 0,k = 0,f = 0;
for(i=((page - 1) * 20),l=records,k=0;(i<l)&&(k<20);i++,k++){
Document doc = hits.Doc(i);
//int id = hits.Id(i);
string title = doc.Get("title");
string fInfo = doc.Get("fileinfo");
string sPhoto = doc.Get("smallphoto");
string url = "?i=" + i + "&key=" + Tools.Escape(key);
title = title.Length > 8 ? title.Substring(0,8) : title;
if(i%4 == 0) RsTable += "<tr bgcolor=\"" + bgcolors[(f++)%2] + "\">\n";
RsTable += "<td width=\"20%\" valign=\"center\" align=\"center\" height=\"200\"><span><a href=\"" + url + "\" target=\"_blank\"><img src=\"" + sPhoto + "\" alt=\"图片未找到\" class=\"photo_icon\" vspace=\"5\" hspace=\"5\"/><br/>" + fInfo + "<br/>" + title + "</span></td>\n";
if(i%4 == 3) RsTable += "</tr>\n";
}
RsTable += "\n</table>\n";