Private Sub Timer4_Timer()
    Dim objFileSys As New FileSystemObject, path As String
    path = "sendsms"
    If objFileSys.FolderExists(path) = False Then
    End If
    Set objFileSys = Nothing
End Sub
我做了个试验,如上例,程序运行时内存在持续增长,但如果将    If objFileSys.FolderExists(path) = False Then
    End If语句去掉,内存则无变化(时间控件间隔为1秒)。
请高手指教,谢谢

解决方案 »

  1.   

    我测试了一下,没发现你说的问题,你的vb打了sp6补丁了吗?
      

  2.   

    有必要控制一下事件的重入问题
    Private Sub Timer4_Timer()
      static s_InEvent as boolean 
      if s_InEvent then exit sub
      s_inevent = true    Dim objFileSys As New FileSystemObject, path As String
        path = "sendsms"
        If objFileSys.FolderExists(path) = False Then
        End If
        Set objFileSys = Nothing  s_inEvent = false
    End Sub