我是一个 vbscript 新手,想搜索一些我通过 ftp 下载的文件。我运行了一个脚本来下载文件现在我不确定如何运行脚本来搜索所有文件。这就是我所拥有的,但我认为我应该使用 select case 语句。
抱歉,如果这段代码看起来很粗糙
Sub ReadDownloads()
Dim strInput As String
strInput = "file\path\somefile.ftp"
Dim dhigh, dclose, dlow
Close #1
Open strInput For Input As #1
Input #1, strReadLine
Input #1, strReadLine
While Not EOF(1)
Input #1, strReadLine
'Debug.Print strReadLine
arrbreakdown = Split(strReadLine, " ")
'Debug.Print arrbreakdown(1)
If Left(arrbreakdown(1), 7) = "itemsearchingfor" Then
If Mid(arrbreakdown(1), 8, 1) = "c" Then
dclose = arrbreakdown(3)
ElseIf Mid(arrbreakdown(1), 8, 1) = "h" Then
dhigh = arrbreakdown(3)
ElseIf Mid(arrbreakdown(1), 8, 1) = "l" Then
dlow = arrbreakdown(3)
End If
End If
Wend
Close #1
Debug.Print dclose
Debug.Print dhigh
Debug.Print dlow
Range("D2").Value = dclose
Range("E2").Value = dhigh