473,511 Members | 11,345 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

search for specific filename from folder

Fary4u
273 Contributor
Hi

i've got folder with lots of images on it,
what i would like to do is trying to seach the specific image filename
using ( FileSystemObject ) & textbox

i've got this code that can search the files in folder bringing full list of file.

Expand|Select|Wrap|Line Numbers
  1.     set FileSysObj=CreateObject("Scripting.FileSystemObject")
  2.     strFileAndPath = request.servervariables("SCRIPT_NAME")
  3.     strPathOnly = Mid(strFileAndPath,1 ,InStrRev(strFileAndPath, "/"))
  4.     strFullPath = server.mappath(strPathOnly)
  5.     set fldr=FileSysObj.GetFolder(strFullPath)
  6.  
  7.     set FileList = fldr.Files
  8.     For Each FileIndex in FileList
  9.         'This bit excludes this page (and other asp files) from the list of links
  10.         if Lcase(right(FileIndex.Name, 4)) <> ".ini" then
  11.             Response.Write("<A HREF='" & FileIndex.name & "'>" & FileIndex.name & "</A><BR>")
  12.         end if
  13.     Next
  14.  
IS ANY BODY KNW HOW TO GET CRACK ON TO ACHIVE THIS RESULT ?
May 12 '09 #1
2 3669
Fary4u
273 Contributor
any body kw\sssssssssssssssssssssssssssssssssssss
Thxs in advance
May 13 '09 #2
GazMathias
228 Recognized Expert New Member
This bit:

Expand|Select|Wrap|Line Numbers
  1.  Response.Write("<A HREF='" & FileIndex.name & "'>" & FileIndex.name & "</A><BR>")
  2.  
Becomes:

Expand|Select|Wrap|Line Numbers
  1. If instr(FileIndex.name,"[YOUR TEXT HERE]") >0 Then
  2. Response.Write("<A HREF='" & FileIndex.name & "'>" & FileIndex.name & "</A><BR>")
  3. End if
Obviously you need to feed the [YOUR TEXT HERE] bit with something.

Gaz
May 14 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

11
15623
by: Ben | last post by:
Greetings, I am looking for a way to search for and delete files based on a pattern mask. For example, the search method would find all files matching a certain pattern containing wildcards (e.g....
1
8700
by: Les Juby | last post by:
A year or two back I needed a search script to scan thru HTML files on a client site. Usual sorta thing. A quick search turned up a neat script that provided great search results. It was fast,...
0
4202
by: Chung Leong | last post by:
Here's a short tutorial on how to the OLE-DB extension to access Windows Indexing Service. Impress your office-mates with a powerful full-text search feature on your intranet. It's easier than you...
3
9528
by: Chung Leong | last post by:
Here's the rest of the tutorial I started earlier: Aside from text within a document, Indexing Service let you search on meta information stored in the files. For example, MusicArtist and...
2
1062
by: pa2ratczi | last post by:
Hi there, am having trouble with my program, its a file locator program just like a search engine in a local drive: heres wat i have coded: Private Sub Command1_Click() Dim SearchFile As String...
2
1740
by: Krustov | last post by:
I wrote this a while ago and found it comes in very handy at times . For example , If you want to know what webpages use a certain stylesheet its just a matter of typing in the stylesheet name...
5
7541
by: Alice | last post by:
I'm trying to upload all .txt files from a specific folder using the following code, but it didn't work. HELP The problem lies in DoCmd.TransferText acImportFixed, "Imperial Import...
7
7364
by: molle | last post by:
Hi! Does anyone know a searchscript to create a javascript file-search. I want it to be able to search for a specific filename in a folder INCLUDING its sub-folders. I know there is a way to...
0
10707
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
7251
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7148
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7367
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7517
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5072
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3217
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1581
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
451
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.