我在练习从文件中读数据时,为什么系统老是提示我 未处理的“System.IO.FileNotFoundException”类型的异常出现在 mscorlib.dll 中。
其他信息: 未能找到文件“D:\liangvb\WindowsApplication7\bin\data.txt”。 我明明建了文件data.txt放在该目录下,请帮忙,谢谢!下面是我抄的书上的程序: Private Sub btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn.Click Dim sr As IO.StreamReader Dim filename, prompt, title, street As String Dim housenum As Double prompt = "Enter the name of the file containing the information." title = "Name of File" filename = InputBox(prompt, title) sr = IO.File.OpenText(filename) housenum = CDbl(sr.ReadLine) street = sr.ReadLine sr.Close() txtbox.Text = "the street is located at" & housenum & " " & street & "." End Sub