使用filesystemobject来读写文件使用timer控件来定时

解决方案 »

  1.   

    Private Sub Form_Click()
    '"C:\Documents and Settings\den\桌面\1.txt"自定你的路径
    Open "C:\Documents and Settings\den\桌面\1.txt" For Output As #1
    For x = 1 To 10  Print #1, "68"
      
      Print #1, "本所有软工数据"
      Print #1, "56  78"
    Next
    Close #1
    End Sub
      

  2.   

    Private Sub Form_Click()'开始
     Timer1.Interval = 1000
     Open "C:\Documents and Settings\den\桌面\1.txt" For Output As #1
     Timer1.Enabled = True
    End SubPrivate Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
      '结束
      Timer1.Enabled = False
      Close #1End SubPrivate Sub Timer1_Timer()
     '定时写入
      Print #1, ""
      Print #1, "68"
      Print #1, "本所有软工数据"
      Print #1, "56  78"
     
    End Sub
      

  3.   

    up , 用timer控件加open ......,print ....
      

  4.   

    我建议你仔细研究一下FileSystemObject它对于文件操作很好用。
      

  5.   

    这样可以了吗?
    Private Sub Timer1_Timer()
    Static A As Long
     A = A + 1
      Open "C:\Documents and Settings\den\桌面\1.txt" For Output As #1
      Print #1, A
      Print #1, "本所有软工数据"
      Print #1, A & A
      Close #1End Sub
    Private Sub Form_Click() '开始
      Timer1.Interval = 1000
      Timer1.Enabled = True
    End SubPrivate Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
      '结束
      Timer1.Enabled = False
    End Sub
    可以就快快给分啦!