How to use GetFiles
(Saturday, August 28, 2004)
Found the following interesting discussion in the Newsgroups:
How to use GetFiles by:yxq
| Hi, I only can get one file type using GetFiles function,
GetFiles(path, "*.txt")
But if i want to get two or more file types, how to do?
Thanks
| | | Reply: by:yEaH rIgHt
| | | Dim str() as String
str = GetFiles(path, "*.*")
For i = 0 to str.Length -1
If Path.GetExtension(str(i)) = ".txt" or Path.GetExtension(str(i)) = ".doc" then '--- Do whatever End if
Next
| | | Reply: by:Phill. W
| | |
Imports System.IO .. . . For Each eFile As String In Directory.GetFiles(path, "*.*") Select Case Path.GetExtension(eFile).ToLower() Case ".doc", ".txt" ' Do Something End Select Next
HTH, Phill W.
| | | Reply: by:yxq
| | | Thank you
|
Posted by Xander Zelders

|
0 Comments:
Post a Comment
<< Home