在我的asp.net网站上,我想用单词做网站搜索 [英] in my asp.net website i want to do site search with word

查看:86
本文介绍了在我的asp.net网站上,我想用单词做网站搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的asp.net网站上,我想用单词进行网站搜索.


我只想获取XML文件或文本文件的名称(如果该文件包含搜索词).

因为数据存储在XML文件和文本文件中.

请帮助我

In my asp.net website i want to do site search with word.


just I want to get the name of XML file or text file ,if that file contain the searching word.

Because data are stored in XML file and text file.

please help me

推荐答案

在TextReader中读取文件的所有内容并将其存储在字符串中.然后使用 Regex.IsMatch()函数.

Read all content of file in TextReader and store it in string. Then use Regex.IsMatch() function.

Regex.IsMatch(ContentofFile, SearchWord, RegexOptions.IgnoreCase)


它将返回结果项 true false .


it will return result interms of true or false.


这篇关于在我的asp.net网站上,我想用单词做网站搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆