编写关于dir的程序时出现问题
以下是代码(红色为报错句)Dim Rub
Dim sTmp As String * MAX_LEN '存放结果的固定长度的字符串
Dim nLength As Long '字符串的实际长度
Dim pidl As Long '某特殊目录在特殊目录列表中的位置
Dim sTmp2 As Integer '临时存储变量
Dim sTmp3(0 To 100) As Integer 'A数值存储数组"
Command1.Enabled = False
Dim ab As Integer
ListView1.ListItems.Add , , "获取Cookies目录"
SHGetSpecialFolderLocation 0, COOKIES, pidl
SHGetPathFromIDList pidl, sTmp
ListView1.ListItems(1).SubItems(1) = Left(sTmp, InStr(sTmp, Chr(0)) - 1)
ListView1.ListItems.Add , , "获取Temp目录"
sTmp2 = GetTempPath(MAX_LEN, sTmp)
ListView1.ListItems(2).SubItems(1) = Left(sTmp, sTmp2)
ListView1.ListItems.Add , , "获取System目录"
sTmp2 = GetSystemDirectory(sTmp, MAX_LEN)
ListView1.ListItems(3).SubItems(1) = Left(sTmp, sTmp2)
ListView1.ListItems.Add , , "获取网页临时文件目录"
SHGetSpecialFolderLocation 0, PAGETMP, pidl
SHGetPathFromIDList pidl, sTmp
ListView1.ListItems(4).SubItems(1) = Left(sTmp, InStr(sTmp, Chr(0)) - 1)
Dim a As Integer
ListView1.ListItems.Add , , "Cookies文件"
Rub = Dir(ListView1.ListItems(1).SubItems(1) & "\*.*")
ListView1.ListItems(a + 5).SubItems(1) = Rub
ListView1.ListItems(a + 5).SubItems(2) = "等待删除"
a = a + 1
sss:
On Error GoTo sss2
Rub = Dir
ListView1.ListItems.Add , , "Cookies文件"
ListView1.ListItems(a + 5).SubItems(1) = Rub
ListView1.ListItems(a + 5).SubItems(2) = "等待删除"
a = a + 1
GoTo sss
sss2:
On Error GoTo 0
ListView1.ListItems(a + 4).SubItems(1) = "搜索完毕!"
ListView1.ListItems(a + 4).SubItems(2) = ""
sTmp3(0) = a + 4
Rub = Dir(ListView1.ListItems(2).SubItems(1) & "*.*")
ListView1.ListItems.Add , , "Tmp文件"
ListView1.ListItems(a + 5).SubItems(1) = Rub
ListView1.ListItems(a + 5).SubItems(2) = "等待删除"
a = a + 1
sss3:
On Error GoTo sss4
Rub = Dir
ListView1.ListItems.Add , , "Tmp文件"
ListView1.ListItems(a + 5).SubItems(1) = Rub
ListView1.ListItems(a + 5).SubItems(2) = "等待删除"
a = a + 1
GoTo sss3
sss4:
ListView1.ListItems.Add , , "Tmp文件"
ListView1.ListItems(a + 5).SubItems(1) = "搜索完毕!"
sTmp3(1) = a + 5
On Error GoTo 0
Rub = Dir(ListView1.ListItems(3).SubItems(1) & "\*.*")
ListView1.ListItems.Add , , "网页临时文件"
ListView1.ListItems(a + 5).SubItems(1) = Rub
ListView1.ListItems(a + 5).SubItems(2) = "等待删除"
a = a + 1
sss5:
On Error GoTo sss6
Rub = Dir
ListView1.ListItems.Add , , "网页临时文件"
ListView1.ListItems(a + 5).SubItems(1) = Rub
ListView1.ListItems(a + 5).SubItems(2) = "等待删除"
a = a + 1
GoTo sss5
sss6:
On Error GoTo 0
ListView1.ListItems.Add , , "网页临时文件"
ListView1.ListItems(a + 5).SubItems(1) = "搜索完毕!"
sTmp3(1) = a + 5
报错讯息为:5号错误:无效的过程调用或参数。
不知道改动了什么出现了这个错误。
[ 本帖最后由 renxiaoyao36 于 2015-3-26 18:03 编辑 ]