vb更改文本文件内容
答案:5 悬赏:80 手机版
解决时间 2021-03-25 13:36
- 提问者网友:戎马万世
- 2021-03-24 13:44
vb更改文本文件内容
最佳答案
- 五星知识达人网友:何以畏孤独
- 2021-03-24 14:30
添加按钮(修改)
Private Sub Command1_Click()
Open App.Path & "\setting.ini" For Output As #1
For i = 1 To 5
Write #1, Text1(i - 1).Text
Next
Close (1)
End Sub
Private Sub Form_Load()
Dim a As String
If Dir(App.Path & "\setting.ini") <> "" Then
Open App.Path & "\setting.ini" For Input As #1
For i = 1 To 5
Line Input #1, a
Text1(i - 1).Text = a
Next
Close (1)
Else
Open App.Path & "\setting.ini" For Output As #1
Close (1)
End If
End Sub
Private Sub Command1_Click()
Open App.Path & "\setting.ini" For Output As #1
For i = 1 To 5
Write #1, Text1(i - 1).Text
Next
Close (1)
End Sub
Private Sub Form_Load()
Dim a As String
If Dir(App.Path & "\setting.ini") <> "" Then
Open App.Path & "\setting.ini" For Input As #1
For i = 1 To 5
Line Input #1, a
Text1(i - 1).Text = a
Next
Close (1)
Else
Open App.Path & "\setting.ini" For Output As #1
Close (1)
End If
End Sub
全部回答
- 1楼网友:执傲
- 2021-03-24 16:58
好像好似open 目录 as #1有点忘了
- 2楼网友:野慌
- 2021-03-24 15:52
好像有个api函数可以调用的,他可以对ini文件的节,项和项值经行操作,到网上搜搜看
- 3楼网友:摆渡翁
- 2021-03-24 15:14
有些程序不是用VB写出来的。。。有些直接用记事本写出来的。
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯