ÄúµÄλÖãºÊ×Ò³ >> Web¿ª·¢ >> JSP¼¼Êõ >> JSPʵÀý >> ÕýÎÄ
RSS
 

ͶƱϵͳԭ´úÂ루JSPʵÏÖ£©

http://www.rdxx.com 02Äê04ÔÂ03ÈÕ 11:20 »¥ÁªÍø ÎÒҪͶ¸å

¹Ø¼ü´Ê£º ͶƱ , JSP , ϵͳ , ´úÂë

ÕâÊÇÓÃÎı¾Îļþ×÷Ϊ´æ´¢ÔØÌåµÄͶƱϵͳ£º

vote.java:


// Java Document
package 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<n;i++) fileWrite.println("0");
             fileWrite.close();
             }
}
public void writeFile()
       throws FileNotFoundException
        {
        fileWrite=new PrintWriter(new FileOutputStream(filePath));
        for(int i=0;i<n;i++)
        {
        fileWrite.println(voteNum[i]);
        }
             fileWrite.close();
           }
public void readFile()
            throws FileNotFoundException
                 {
                 fileRead=new BufferedReader(new FileReader(filePath));
                 for(int i=0;i<n;i++)
                 {
                 try
                 {voteStr[i]=fileRead.readLine();
                 }
                 catch(IOException f)
                 {
                 voteStr[i]="0";}
                 voteNum[i]=Integer.parseInt(voteStr[i]);
                 }
                 try
                 {      
                 fileRead.close();
                 }
                 catch(IOException d)
                 {
                 systemMessage=d.toString();

9 7 3 1 2 3 4 4 8 :

 
 
±êÇ©£º ͶƱ , JSP , ϵͳ , ´úÂë ´òÓ¡±¾ÎÄ
 
 
  ÈȵãËÑË÷
 
 
 



Valid XHTML 1.0 Transitional
Copyright ©2005 - 2008 Rdxx.Com£¬All Rights Reserved
Êղر¾Ò³
Êղر¾Õ¾