void saveToFile(String path, String name, String con)
{
if(!name.endsWith(".txt"))
name = name + ".txt";
File file = new File(path + File.separator + name);
FileOutputStream fos = null;
try
{
if(!file.exists())
{
file.createNewFile();
}
fos = new FileOutputStream(file);
fos.write(con.getBytes());
} catch (Exception e)
{
System.out.println("文件出错");
}
finally
{
try
{
fos.flush();
fos.close();
} catch (IOException e)
{
}
}
}