新手求教,大家帮忙来找茬
我一本教材上抄了一段,运行后提示 输入超出文件尾,我想知道这是为什么,应该怎么解决,谢谢。Private Sub Command1_Click()
CommonDialog1.Filter = "文档文件 (*.txt)|*.txt|所有文件(*.*)|*.*"
CommonDialog1.ShowOpen
Open CommonDialog1.FileName For Input As #1
Text1.Text = StrConv(Input(LOF(1), 1), vbUnicode)
Close #1
End Sub
Private Sub Command2_Click()
CommonDialog1.Filter = "文档文件 (*.txt)|*.txt|所有文件(*.*)|*.*"
CommonDialog1.ShowSave
Open CommonDialog1.FileName For Output As #1
Close #1
End Sub
Private Sub Form_Load()
Command1.Caption = "打开文本文件"
Command2.Caption = "保存文本文件"
End Sub