If searchPatterns.Length <= 0 Then
Return Nothing
Else
Dim di As New DirectoryInfo(dirPath)
Dim fis As FileInfo()() = New FileInfo(searchPatterns.Length - 1)() {}
Dim count As Integer = 0
Dim i As Integer = 0
While i < searchPatterns.Length
Dim fileInfos As FileInfo() = di.GetFiles(searchPatterns(i))
fis(i) = fileInfos
count += fileInfos.Length
System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
End While
Dim files As String() = New String(count - 1) {}
Dim n As Integer = 0
Dim i As Integer = 0
While i <= fis.GetUpperBound(0)
Dim j As Integer = 0
While j < fis(i).Length
Dim temp As String = fis(i)(j).FullName
files(n) = temp
System.Math.Max(System.Threading.Interlocked.Increment(n),n - 1)
System.Math.Max(System.Threading.Interlocked.Increment(j),j - 1)
End While
System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
End While
Return files
End If
End Function
Dim files As String() = GetPictures("*.gif", "*.jpg", "*.png")
[本日志由 tiancao1001 于 2018-08-11 01:46 PM 编辑]
|
暂时没有评论
发表评论 - 不要忘了输入验证码哦! |