String filename = "//" new java.sql.date (system.currenttimemillis ()). TOSTRING () ". Txt";
String path = Request.getRealPath ("."); //Out.println (PATH); file f = new file (path, filename); //out.println (F); //out.println (F.exists ())
IF (F.Exists ()) {// Check if file.txt exists
} else {f.createNewFile (); // Create a file named file.println (Path FileName "in the current directory does not exist, established."); // Output current directory path }
PATH = Request.getRealPath (".");
INT count; // read a line data try {fileReader fr = new fileReader (Path filename); bufferedReader br = New BufferedReader (fr); // Establish a bufferedReader object, and instantiate BR String line = br.readline () Count = integer.valueof (line) .intValue (); br.close (); // Close BufferedReader object fr.close ();} catch (excEption e) {count = 0;}
COUNT ;;
FileWriter FW = New FileWriter (Path FileName); // Establish a FileWriter object, and instantiate FW // writes the string to file fw.write (string.valueof (count)); fw.close ();
Out.println (String.Valueof (count) "
");