-
FileSystem: Serach File
I have 5000+ PDF files sitting in 300+ folders. I am not using any type of
database.
By using ASP, Can I:
1)Search for a file name, i.e. asp*.PDF or *asp.PDF; and,
2)Search for content, i.e. About ASP.
Please do NOT assume to use Windows Explorer to do the search.
Your prompt reply with a sample of code is appreciated.
-
Re: FileSystem: Serach File
From ASP, you can use Scripting.FilesystemObject for this purpose. This will
give you some ideas:
==================================
' Returns filename with specified extension. If more than one *.INI
' file exists, the first file found is returned.
MyFile = Dir("C:\WINDOWS\*.INI")
' Call Dir again without arguments to return the next *.INI file in the
' same directory.
MyFile = Dir()
' Return first *.TXT file, including files with a set hidden attribute.
MyFile = Dir("*.TXT", vbHidden)
' Display the names in C:\ that represent directories.
MyPath = "c:\" ' Set the path.
MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry.
Do While MyName <> "" ' Start the loop.
' Use bitwise comparison to make sure MyName is a directory.
If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory Then
' Display entry only if it's a directory.
Debug.WriteLine(MyName)
End If
MyName = Dir() ' Get next entry.
Loop
==================================
For further knowledge on FilesystemObject API and usage, see http://msdn.microsoft.com/library/de...ce09072000.asp
Hope that helps.
-Biswa.
"woogor" <zhang5gor@yahoo.com> wrote:
>
>I have 5000+ PDF files sitting in 300+ folders. I am not using any type
of
>database.
>
>By using ASP, Can I:
>1)Search for a file name, i.e. asp*.PDF or *asp.PDF; and,
>2)Search for content, i.e. About ASP.
>
>Please do NOT assume to use Windows Explorer to do the search.
>
>Your prompt reply with a sample of code is appreciated.
>
-
Re: FileSystem: Serach File
Where are you using FileSystemObject in your example? Looks like straight
VBScript to me.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
"unifav" <unifav@singapore.com> wrote in message
news:3ddb1977$1@tnews.web.devx.com...
>
> From ASP, you can use Scripting.FilesystemObject for this purpose. This
will
> give you some ideas:
>
> ==================================
> ' Returns filename with specified extension. If more than one *.INI
> ' file exists, the first file found is returned.
> MyFile = Dir("C:\WINDOWS\*.INI")
>
> ' Call Dir again without arguments to return the next *.INI file in the
> ' same directory.
> MyFile = Dir()
>
> ' Return first *.TXT file, including files with a set hidden attribute.
> MyFile = Dir("*.TXT", vbHidden)
>
> ' Display the names in C:\ that represent directories.
> MyPath = "c:\" ' Set the path.
> MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry.
> Do While MyName <> "" ' Start the loop.
> ' Use bitwise comparison to make sure MyName is a directory.
> If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory Then
> ' Display entry only if it's a directory.
> Debug.WriteLine(MyName)
> End If
> MyName = Dir() ' Get next entry.
> Loop
> ==================================
> For further knowledge on FilesystemObject API and usage, see
http://msdn.microsoft.com/library/de...us/dnofftalk/h
tml/office09072000.asp
>
> Hope that helps.
> -Biswa.
>
> "woogor" <zhang5gor@yahoo.com> wrote:
> >
> >I have 5000+ PDF files sitting in 300+ folders. I am not using any type
> of
> >database.
> >
> >By using ASP, Can I:
> >1)Search for a file name, i.e. asp*.PDF or *asp.PDF; and,
> >2)Search for content, i.e. About ASP.
> >
> >Please do NOT assume to use Windows Explorer to do the search.
> >
> >Your prompt reply with a sample of code is appreciated.
> >
>
-
Re: FileSystem: Serach File
I use ADO to query the Microsoft Indexing Service. These links should get
you started.
Indexing Service Start Page
http://msdn.microsoft.com/library/de...tpage_6td1.asp
ADO - Microsoft OLE DB Provider for Microsoft Indexing Service
http://msdn.microsoft.com/library/de...rvprovspec.asp
Some Other Links on Microsoft Indexing Service
http://www.windowswebsolutions.com/A...rticleID=20593
http://www.windowswebsolutions.com/A...rticleID=21223
http://www.simongibson.com/intranet/...indexserv.html
Jake Duckworth
"woogor" <zhang5gor@yahoo.com> wrote:
>
>I have 5000+ PDF files sitting in 300+ folders. I am not using any type
of
>database.
>
>By using ASP, Can I:
>1)Search for a file name, i.e. asp*.PDF or *asp.PDF; and,
>2)Search for content, i.e. About ASP.
>
>Please do NOT assume to use Windows Explorer to do the search.
>
>Your prompt reply with a sample of code is appreciated.
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks