VB如何打开一个文本文件?

VB如何打开一个文本文件?,第1张

1、获取文本文件路径\x0d\x0a2、通过流的方式打开文本文件\x0d\x0a示例:\x0d\x0aDim MyString\x0d\x0aPrivate Sub Command1_Click() ’按钮事件\x0d\x0a Open App.Path + "\Myfile.txt" For Input As #1 '打开文本文件,读取。\x0d\x0a Do While Not EOF(1) '是否没到文件末尾\x0d\x0a Input #1, MyString '读取文件内容\x0d\x0a Loop\x0d\x0a Close #1\x0d\x0aEnd Sub

Private

Sub

Command1_Click()

Shell

"d:\中文文件夹\loe.exe",

vbNormalFocus

'打开你指定的文件

Timer1.Enabled

=

True

'开始计时

Timer1.Interval

=

60000

End

Sub

Private

Sub

Timer1_Timer()

Command2_Click

End

Sub

Private

Sub

Command2_Click()

MsgBox

"command2被点击了!"

End

Sub


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/tougao/11495268.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-16
下一篇 2023-05-16

发表评论

登录后才能评论

评论列表(0条)

保存