vb 修改指定行
有C:\a.txt。修改前几个字是“live1=”这行,当然后面还有内容,修改的内容是Text1的。...
有C:\a.txt。修改前几个字是“live1 =”这行,当然后面还有内容,修改的内容是Text1的。
展开
2个回答
展开全部
Private Sub Command1_Click()
Open "C:\a.txt" For Input As #1
Do Until EOF(1)
Line Input #1, a
If Left(a, 6) = "live1=" Then
a = "live1=" & Text1.Text
End If
S = S & a
Loop
Close #1
Open "C:\a.txt" For Output As #1
Input #1, S
Close #1
End Sub
Open "C:\a.txt" For Input As #1
Do Until EOF(1)
Line Input #1, a
If Left(a, 6) = "live1=" Then
a = "live1=" & Text1.Text
End If
S = S & a
Loop
Close #1
Open "C:\a.txt" For Output As #1
Input #1, S
Close #1
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询