vb 如何写入文件第一行

2024-12-12 13:19:34
推荐回答(2个)
回答1:

文件操作没办法只替换第一行,只能读出全部,再写回去。

回答2:

这样

Dim s As String

Open c For Binary As #1
s = Input(LOF(1), 1)
Close #1

Open c For Output As #1
Print #1, "" & vbCrLf & s
Close #1