问题描述
我很难理解如何根据用户输入(最多10个字符输入)构建搜索程序以搜索文件夹目录,打开文件夹并打开文件夹中的.htm文件。我需要做什么代码?这个
会在网页上发布,还是应该在JavaScript中完成?
I am having some difficulty understanding how to build a search program to search a directory of folders, based on user input(up to 10 character input), open the folder and open the .htm file in the folder. What codes do I need to do this? This is going on a webpage, or should it be done in JavaScript?
推荐答案
我想将您的问题反汇编为3部分:
I would like to disassemble your question into 3 parts:
1. 由于您说它是在网页上进行的,因此取决于您提到的文件夹服务器或客户端。如果文件夹在服务器上,那么你可以用ASP.Net或ASP.Net MVC来完成;否则,JavaScript可以帮助您访问客户端的
文件系统,但是存在安全问题。
1. Since you said it is going on a webpage, it depends on the folders you mentioned is on server or on client side. If the folders are on server, then you could do it with ASP.Net or ASP.Net MVC; otherwise, JavaScript could help you to access the file system for client side, but there shall be security issue.
2。如果您选择ASP.Net或ASP.Net MVC,那么您可以尝试使用LINQ 表达式来搜索您的文件夹。
2. If you choose ASP.Net or ASP.Net MVC, then You could try to use LINQ expression to search your folders.
3。如果您对C#不太熟悉,有些资源可能会对您有所帮助。
3. If you're not so familiar with C#, there are some resources might be helpful to you.
C#Absolutement for Absolute Beginners
希望这对您有所帮助。
这篇关于帮助构建基本搜索程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!