• 大小: 50.61 KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2024-12-08
  • 语言: Java
  • 标签: C/S  考试系统  

资源简介

运行前先看说明,文件列表:
123.txt 804 18-12-05|13:17
ChoiceFile.class 2916 18-12-05|13:06
ChoiceFile.java 2721 09-12-03|09:12
Client$1.class 474 31-03-09|15:07
Client.class 4315 31-03-09|15:07
Client.java 3834 09-12-03|09:10
ClientTestArea.class 5216 18-12-05|13:06
ClientTestArea.java 6260 09-12-03|09:12
FileName.class 640 31-03-09|15:06
ReadTestquestion.class 3058 18-12-05|13:06
ReadTestquestion.java 3853 21-12-03|23:02
Server.class 1036 31-03-09|15:06
Server.java 4303 09-12-03|09:05
Server_thread.class 2922 31-03-09|15:06
说明.doc 52224 31-

03-09|15:04
cs结构的考试系统 0 31-03-09|16:52

资源截图

代码片段和文件信息

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;
public class ChoiceFile extends Panel implements ItemListenerActionListenerRunnable
{
   Button 得到试题文件=null;
   Choice list=null; 
   Socket  socket=null;
   DataInputStream in=null; 
   DataOutputStream out=null; 
   Thread thread=null;
   boolean success=false isSelected=false;
   int n=0;
   
   public ChoiceFile()
    {
      得到试题文件=new Button(“将试题文件添加到下拉列表中“);
      得到试题文件.setEnabled(false);
      得到试题文件.addActionListener(this);
      list=new Choice();
      list.add(“**********“);
      add(得到试题文件);
      add(list);
      list.addItemListener(this);
      thread=new Thread(this);
    }
  public void setSocketConnection(Socket socketDataInputStream inDataOutputStream out)
    {
      this.socket=socket;
      this.in=in;
      this.out=out; 
      try {
            thread.start(); 
          }
      catch(Exception ee)
          {
          }
      if(this.socket!=null)
       {
         得到试题文件.setEnabled(true);
       } 
    }
   public void actionPerformed(ActionEvent e)
    {
         try 
           { 
             out.writeUTF(“列出考试文件“);
           }
           catch(IOException ee)
           { 
             success=false;
           }
       
    } 
  public void itemStateChanged(ItemEvent e)
    { 
      n=list.getItemCount();
      if(n>=1&&isSelected==true)
        {
          String listItem=list.getSelectedItem();
           try
              {
                out.writeUTF(“考试文件的名字:“+listItem);
                out.writeUTF(“请通知考试界面考试用时:“);
              }
           catch(IOException ee)
              {
              }
        }         
   }
  public String 得到选择的文件名()
   {
    return list.getSelectedItem();
   }
  public void run()
   {
    String s=null;
    list.removeAll();
    while(true)
      { 
        try
           {
             s=in.readUTF();          
              if(s.startsWith(“考试文件:“))
                 {
                   String listItem=s.substring(s.indexOf(“:“)+1);
                   list.add(listItem);
                   isSelected=true;
                 }
               if(s.startsWith(“已经全部列出:“))
                 {
                   success=true; 
                   break;
                 }
               
           }
        catch (Exception ee) 
           {
           }   
      }
 }
 public boolean getSuccess()
 { 
   n=list.getItemCount();
   if(n>0&&success==true)
      return true;
   else
      return false;
 }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        804  2005-12-18 13:17  CS架构考试系统\123.txt

     文件       2916  2005-12-18 13:06  CS架构考试系统\ChoiceFile.class

     文件       2721  2003-12-09 09:12  CS架构考试系统\ChoiceFile.java

     文件        474  2009-03-31 15:07  CS架构考试系统\Client$1.class

     文件       4315  2009-03-31 15:07  CS架构考试系统\Client.class

     文件       3834  2003-12-09 09:10  CS架构考试系统\Client.java

     文件       5216  2005-12-18 13:06  CS架构考试系统\ClientTestArea.class

     文件       6260  2003-12-09 09:12  CS架构考试系统\ClientTestArea.java

     文件        640  2009-03-31 15:06  CS架构考试系统\FileName.class

     文件       3058  2005-12-18 13:06  CS架构考试系统\ReadTestquestion.class

     文件       3853  2003-12-21 23:02  CS架构考试系统\ReadTestquestion.java

     文件       1036  2009-03-31 15:06  CS架构考试系统\Server.class

     文件       4303  2003-12-09 09:05  CS架构考试系统\Server.java

     文件       2922  2009-03-31 15:06  CS架构考试系统\Server_thread.class

     文件      52224  2009-03-31 15:04  CS架构考试系统\说明.doc

     目录          0  2011-04-18 14:17  CS架构考试系统

----------- ---------  ---------- -----  ----

                94576                    16


评论

共有 条评论