进行搜索引擎的详细说明 [英] A Detailed description to do a SEARCH ENGINE

查看:77
本文介绍了进行搜索引擎的详细说明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要做一个适用于PowerPoint文件的搜索引擎.

I need to do a search engine that works on power point files.

在我的.vb(.net框架)代码文件中,我设计了一个按钮和一个文本框,当我在文本框中键入文件名时,文件名将显示在listview中. (很好)

in my .vb (.net framework) code file i have designed a button and a textbox and when i key in the filename in the textbox, the filename show up in the listview . (which is good)

但是我要输入一个关键字,搜索结果应该是包含该单词的文件名.

but what i want is to put a keyword and the search results should be filenames that contain that word.

基本上,搜索引擎应该像这样

basically the search engine should work like this 

如果有人可以告诉我如何完成此任务,

if anyone can tell me how to get this done,

非常感谢(请)

推荐答案

但是我要输入一个关键字,搜索结果应该是包含该单词的文件名.

but what i want is to put a keyword and the search results should be filenames that contain that word.

您是指包含该单词的文件名,还是包含该单词的文件名?

Do you mean filenames that contain that word, or the names of files that contain that word?

要查找文件名中是否包含该单词,请使用String对象的.Contains方法和文件名列表:
https://msdn.microsoft.com/en-us/library/dy85x1sa (v = vs.110).aspx

To find if any of the filenames contains that word, use the .Contains method of the String object with the filename list:
https://msdn.microsoft.com/en-us/library/dy85x1sa(v=vs.110).aspx

读取文件的说明如下:
https://msdn.microsoft.com/en-us/library/wz100x8w.aspx

Reading a file is described here:
https://msdn.microsoft.com/en-us/library/wz100x8w.aspx

如果您以文本形式读取文件,则可以对文件内容使用.contains方法.您可能需要将其读取为字节数组并将该数组转换为字符串,以避免出现错误的结尾文件条件.即使应该也可以 该文件不是文本文件,但值得测试.

If you read a file as text then you can use the .contains method with the file contents. You may need to read it as a byte array and convert the array to string, in order to avoid a false end-of-file condition.  That should work even though the file is not a text file, but is worth testing.


这篇关于进行搜索引擎的详细说明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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