java实战学习四

public String videoCapture(String pictureName){
String sRt = "保存失败!";
PropertiesUtil propertiesUtil = PropertiesUtil.getPropertiesUtil();
String hight = propertiesUtil.getProperties().getProperty("Hight");
String low = propertiesUtil.getProperties().getProperty("Low");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
SimpleDateFormat dateFormat2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String currentTime = dateFormat.format(new Date());
String currentTime2 = dateFormat2.format(new Date());
hight = hight+File.separator+currentTime+"_"+pictureName+".png";
low = low+File.separator+currentTime+"_"+pictureName+".png";
String log="";
if(pictureName.equals("Laser")) {
pictureName="激光";
}else if(pictureName.equals("Infrared")) {
pictureName="红外";
}else if(pictureName.equals("Vibration")) {
pictureName="震动";
}else if(pictureName.equals("Ultrasonic")) {
pictureName="超声波";
}
log=currentTime2+" "+pictureName+"报警抓拍图片已保存 保存路径:"+hight;

 

一个判断的语句,输入的一个变量,在选择判断之后改变输出变量

在修改类似有前端的东西时,在tool文件夹下寻找

 

 

 

注意看注释,正常7行注释,3行代码,可以把代码先收起来,

 

posted @ 2019-08-23 15:24  xxcxycai  阅读(102)  评论(0编辑  收藏  举报