老师, 计划任务执行有错误,请您指导一下

此主题相关图片如下:提示.png

Dim y,m,d As Integer
Dim dFile As New Dictionary(Of Date, String)
Dim drs,drs2 As List (of DataRow)
drs2=DataTables("备份").Select("[备份类型]='账套备份'")
For Each dr2 As DataRow In drs2
Dim namelen As Integer=dr2("备份计划名称").Length
Dim filelen As Integer=dr2("备份路径").Length
For Each File As String In FileSys.GetFiles(dr2("备份路径"))
If File.SubString(filelen,namelen)=dr2("备份计划名称") Then
dFile.Add(new Date(File.SubString(File.Length-12,8)),File)
End If
Next
For Each k As Date In dFile.Keys
DateYMD(Date.Now,dFile(k),y,m,d)
If d>=dr2("删除旧备份天数") Then '如果距离上次备份已经超过天数的部分
If FileSys.FileExists("& dFile(k).Values &") Then
FileSys.DeleteFile("& dFile(k).Values &",2,2)
End If
End If
Next
dFile.Clear
Next