所以我有一个vb脚本扫描RAP(运行广告程序),如果程序没有上次运行时间,但该程序的全名到一个数组,那么我将这个数组回显到一个消息框.我初始化数组以存储10个值,但为了保持消息框清洁,我想在找到所有程序后重新调整数组大小(不会超过3但是谁知道客户端).但是,我似乎无法让数组调整大小,它打印一个带有10个数组插槽的消息框+它找到的程序.
Dim vprglist(10)
Dim i
Dim strBuf
Dim intIndex
Set vprograms = oUIResource.GetAvailableApplications
i = 0
For Each vprogram In vprograms
If vprogram.LastRunTime = "" Then
vprglist(i) = vprogram.FullName
i = i + 1
End If
Next
ReDim Preserve vprglist(i)
If vprglist <> Null Then
For intIndex = LBound(vprglist) To UBound(vprglist)
strBuf = strBuf & " - " & vprglist(intIndex) & vbLf
Next
vmsgbox = MsgBox("Do you want to Install(Yes) or Defer(No) the follow software: " & vbLf & strBuf,64+4) …Run Code Online (Sandbox Code Playgroud)