本帖最后由 zhouchao 于 2013-7-7 17:35 编辑
import java.io.*;
import java.util.*;
class RunCount
{
public static void main(String[] args)throws IOException
{
properties prop = new properties();
File file = new File("count.ini")
if(!file.exists())
file.creatNewFile();
FileInputStream fis = new FileInputStream(file);
prop.load(fis);
int count = 0;
String value = prop.getProperty("time");
if(value!=null)
{
count = Integer.parseInt(value);
if(count>=5)
{
System.out.println("您好,使用次数已到,拿钱")
return;
}
}
count++;
prop.setProperty("time",count+"")
FileOutputStream fos = new FileOutputStream(file)
prop.store(fos,"")
fos.close();
fis.close();
}
}
求解 count = Integer.parseInt(value);这句代码的意义
还有prop.setProperty("time",count+"")这个最后为什么是count+""
|