1.报错如下:
<span style="color: #ff0000;">java.io.filenotfoundexception: d: (拒绝访问。)</span>
解决:在设置file file=new file(str); str的时候需要把str精确掉某个文件。例如str="d:"是错误的,应该是<span style="white-space: pre;"> </span> <span style="white-space: pre;"> </span>str="d:\\a.txt"
<span style="color: #ff0000;">java.io.filenotfoundexception: d: (拒绝访问。)</span>
解决:在设置file file=new file(str); str的时候需要把str精确掉某个文件。例如str="d:"是错误的,应该是<span style="white-space: pre;"> </span> <span style="white-space: pre;"> </span>str="d:\\a.txt"