
用vb 如何修改文件中的数据
展开全部
建立一个text文本和两个command按钮,在属性框把text1.multiline文本的属性改为true
private
sub
command1_click()
'打开文本按钮
dim
a
as
string,
b
as
string
open
"c:\documents
and
settings\user\桌面\新建
文本文档
(3).txt"
for
input
as
#1
while
not
eof(1)
input
#1,
a
b
=
b
&
a
&
vbcrlf
wend
close
#1
text1
=
b
end
sub
private
sub
command2_click()
'保存文本按钮
open
"c:\documents
and
settings\user\桌面\新建
文本文档
(3).txt"
for
output
as
#1
print
#1,
text1
close
#1
end
sub
private
sub
command1_click()
'打开文本按钮
dim
a
as
string,
b
as
string
open
"c:\documents
and
settings\user\桌面\新建
文本文档
(3).txt"
for
input
as
#1
while
not
eof(1)
input
#1,
a
b
=
b
&
a
&
vbcrlf
wend
close
#1
text1
=
b
end
sub
private
sub
command2_click()
'保存文本按钮
open
"c:\documents
and
settings\user\桌面\新建
文本文档
(3).txt"
for
output
as
#1
#1,
text1
close
#1
end
sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询