import java.io.File;
public class DeleteTempFile
{
public static void main(String[] args)
{
try
{
File f=new File("D:\\");
File f2=File.createTempFile("temp", ".doc",f);
if(f2.exists())
{
System.out.println(f2.getName());
//f2.delete();删除文件
}
else
{
System.out.println("No:");
}
}
catch(Exception ex)
{
System.out.println(ex);
}
}
}
阅读(1961) | 评论(0) | 转发(0) |