谁能帮我找一下错误

来源:百度知道 编辑:UC知道 时间:2024/05/29 15:18:16
Private Sub fileopen_Click()
CommonDialog1.Action = 1
Text1.Text = ""
Open CommonDialog1.FileName For Input As #1
Do While Not EOF(1)
Line Input #1, inputdata
Text1.Text = Text1.Text + inputdata + Chr(13) + Chr(10)
Loop
Close #1
End Sub
说是:错误的文件名或号码Open CommonDialog1.FileName For Input As #1
谁能帮忙找一下错误,在线等
谢谢

Private Sub fileopen_Click()
CommonDialog1.Action = 1
Text1.Text = ""
If CommonDialog1.FileName <> "" then
Open CommonDialog1.FileName For Input As #1
Do While Not EOF(1)
Line Input #1, inputdata
Text1.Text = Text1.Text + inputdata + Chr(13) + Chr(10)
Loop
Close #1
End If
End Sub