This is a voting system using text files as a storage carrier:
vote.java:
// Java Documentpackage vote; import java.io *;. Import java.util *;. Public class vote extends Object {public String filePath = ""; public int n; private File voteFile; private BufferedReader fileRead; private PrintWriter fileWrite; public String systemMessage = ""; private String voteStr [] = new String [10]; public int voteNum [] = new int [10]; public void createFile () throws FileNotFoundException {voteFile = new File (filePath); if (voteFile! .exists ()) {filewrite = new printwriter (new fileoutputstream (filepath)); for (int i = 0; i }}} Vote.jsp: <% @ Page Contenttype = "text / html; charset = GB2312" Language = "Java" ErrorPage = ""%> <% @ page import = "java.util. *"%> <% @ Page Import = "java.lang. *"%> <% @ page import = "java.io. *"%>