我想问下那些大型门户网站里新闻的特定关键字是怎么做的 就是像网易那里的一些特定的关键字,会自动生成一个链接
解决方案 »
- 求订单走势图实例
- ASP.NET客户端调用默认程序打开服务器上的文件,如pdf,pdg文件
- 求助:用JQuery/dom取得的textarea的值为空
- 请问VS52005里Gridview的图像列怎么显示图像啊?
- 熟悉AJAX ASP.NET对IE要求的一些问题.
- 请问freetextbox 3.0好用吗?
- 微软网站上不去了?怎么回事?
- 关于显示空格的问题???
- 100分问一个简单问题?
- !!!大家好!问个简单问题!^_^
- showModalDialog打开的窗口中,能不能用鼠标选择静态文本,然后进行COPY的操作?
- 为什么在网站上提交信息之后会提示invalid word,然后页面就死掉呢?
private string AddKeyWord(string strInfo,string strKeyWord,string strKeyWordUrl)
{
string strInfos = "";
int count;
string strUrl = "<a href=\"" + strKeyWordUrl + "\">" + strKeyWord + "</a>";
while (true)
{
count = strInfo.IndexOf("<");
if (count != -1)
{
strInfos += strInfo.Substring(0, count).Replace(strKeyWord, strUrl);
strInfo = strInfo.Substring(count);
count = strInfo.IndexOf(">");
if (count != -1)
{
if (strInfo.Substring(0, 2).ToLower() == "<a")
{
count = strInfo.ToLower().IndexOf("</a>") + 4;
strInfos += strInfo.Substring(0, count);
strInfo = strInfo.Substring(count); }
else
{
count++;
strInfos += strInfo.Substring(0, count);
strInfo = strInfo.Substring(count);
}
}
else
{
strInfos += strInfo;
return strInfos;
}
}
else
{
strInfos += strInfo.Replace(strKeyWord, strUrl);
return strInfos;
}
}
}
如果是你自己写的,最好还是弄个关键字列表吧.好处多,又可以分类相关新闻,又可以方便检索.
http://www.rrsou.com/news.aspx?id=7304&page=1