String path = "";
String separator = "";
Properties p = System.getProperties();
separator = p.getProperty("file.separator");
path="路径";//请用separator转换一下"/"符
File delFile=new File(path);
try{
   if(delFile.exists()){
    delFile.delete();
    strMsg="文件存在";
    }else{
          strMsg="找不到文件";
    }
}catch(Exception e){}