1
我想要做的就是从文本文件导入数据。该文件存在于C:\ temp \ text.txt。但是,我不断收到文件未找到错误。我做错了什么?挡住了FileNotFound异常
public static void main(String[] args) throws IOException {
String mFilename = "C:\\temp\\text.txt";
Scanner myDataStream = new Scanner(new File(mFilename));}
是'C:\\ temp \\ temp.txt' ACTUAL文件吗?或者你的例子。 – corsiKa
谷歌搜索引发了一个案件,有人有文件扩展名隐藏,他的文件实际上是'text.txt.txt'。检查它是不是你的情况。 – Vache
glowcoder - 这只是示例名称。 Vache - 你说得对,它是由Windows 7造成的,它隐藏了真正的文件结尾,所以文件实际上是text.txt.txt。我仍然在调整Windows 7 :( –