VB6.0中,将导入的txt文档替换两个字符串后再输出。有谁知道怎么写代码啊?求高人指点!

2025-02-25 20:05:40
推荐回答(2个)
回答1:

private sub command1_click()
L=text1.text
M=text2.text
open "e:\12.txt" for input as #1
while not eof(1)
line input #1,t
s=s & t & vbnewline
wend
close #1
s=replace(s,"321",L)
s=replace(s,"546",M)
open "e:\12.txt" for output as #1
print #1,s
close #1
end sub

回答2:

你的12.txt文档的格式是什么样的?比如说每行包含哪些值,以什么符号分隔,或者说是一个不分行的文本块?