谢谢回复!
我将代码修改成如下,虽能达到要求,但觉得有点曲里拐弯的
Open App.Path & "\Ket.txt" For Input As #1
sIni() = Split(StrConv(InputB(LOF(1), 1), vbUnicode), vbLf)
Close #1
Do While i < UBound(sIni)
If Split(sIni(i), ":")(0) = "德固赛3" Then
sIni(i) = "德固赛3" & ":" & sKSub & ":" & sK & ":" & sKScale
bFlag = True: Exit Do
End If
i = i + 1
Loop
If bFlag Then
Open App.Path & "\Ket.txt" For Output As #1
Print #1, Join(sIni, vbLf)
Close #1 '重写Ket.txt
Else
Open App.Path & "\Ket.txt" For Append As #1
Print #1, "德固赛3" & ":" & sKSub & ":" & sK & ":" & sKScale
Close #1
End If