VB txt文件的保存和读写 小白问题

[复制链接]
查看11 | 回复3 | 2013-8-9 12:43:57 | 显示全部楼层 |阅读模式
Private Sub Form_Unload(Cancel As Integer)'关闭窗体事件If Dir(App.Path & "\Backgroup", vbDirectory) = "" Then MkDir App.Path & "\Backgroup" '判断Backgroup文件夹是否存在,不存在则创建open app.path & "Backgroup\1.txt" for output as #1 '打开文件print #1,text1.text '保存text1的内容到当前目录中Backgroup文件夹内的1.txt文件中close #1 '关闭文件end subPrivate Sub Form_Load()'加载窗体事件dim ...
回复

使用道具 举报

千问 | 2013-8-9 12:43:57 | 显示全部楼层
Private Sub baocun_Click()open app.path+"\1.txt" for output as #1print #1,text1.textclose #1end subPrivate Sub Form_Load()open app.path+"\1.txt" for input as #1input #1,text...
回复

使用道具 举报

千问 | 2013-8-9 12:43:57 | 显示全部楼层
Option ExplicitDim FilePath As String
'储存文件路径Private Sub Command1_Click()Open FilePath For Output As #1Print #1, Text1.TextClose #1End SubPrivate Sub Form_Load()FilePath = App.P...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行