/**
* 讀取text文件內(nèi)容
* @param textsrc
* @return
* @throws IOException
*/
public String readFile(String textsrc) throws IOException{
File myFile=new File(textsrc);
if(!myFile.exists())
{
System.err.println("Can't Find " + textsrc);
}
BufferedReader in = null;
try {
in = new BufferedReader(new FileReader(myFile));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
String str="";
while ((str = in.readLine()) != null)
{
return str;
}
in.close();
return str;
}
}
本站僅提供存儲服務,所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權內(nèi)容,請
點擊舉報。