我想保存字符串到TXT文档,怎么样实现保存换行啊(不用FSO,尽量不添加控件)

解决方案 »

  1.   

    open
    put
    print
    write
    writefile
    createfile
      

  2.   

    给你个简单的列子 参考吧Private filenum As IntegerPrivate Sub Command1_Click()
      For x = 1 To 10 '随机输入10个数
        Savetofile filenum, CStr(Rnd * 100)
      Next
    End SubPrivate Sub Savetofile(filenum As Integer, str As String)
      Print #filenum, str
    End SubPrivate Sub Form_Load()
      filenum = FreeFile
      Open "e:\1.txt" For Output As #filenum
    End SubPrivate Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
      Close #x
    End Sub
      

  3.   

    Close #x
    改成
      Close #filenum
      

  4.   

    哈哈,我还真的是从来没有用过FSO呢。