精华内容
下载资源
问答
  • c语言学生学籍管理系统c语言学生学籍管理系统程序代码如下#include "stdio.h"#include "conio.h"#include "string.h"#include "stdlib.h"#define PF printf#define SF scanfstaticintn,i;structaddress_book{char ...

    c语言学生学籍管理系统

    c语言学生学籍管理系统

    程序代码如下

    #include "stdio.h"

    #include "conio.h"

    #include "string.h"

    #include "stdlib.h"

    #define PF printf

    #define SF scanf

    staticintn,i;

    structaddress_book

    {

    char name[20];

    int num;

    char sex;

    charclas[40];

    long telephone;

    charaddr[40];

    }stud[200];

    void add()

    {

    char j;

    front1:

    system("cls"); /*清屏*/

    PF("\n");

    PF("\n请输入要添加的姓名:");

    SF("%s",stud[n].name);

    PF("\n请输入要添加的学号(8位):");

    SF("%d",&stud[n].num);

    PF("\n请输入要添加的性别(F/M):");

    SF("\n%c",&stud[n].sex);

    PF("\n请输入要添加的班级:");

    SF("%s",&stud[n].clas);

    PF("\n请输入要添加的电话号码:");

    SF("%ld",&stud[n].telephone);

    PF("\n请输入要添加的地址:");

    SF("%s",stud[n].addr);

    展开全文
  • C++设计的学生学籍查询管理系统 里面论文代码都完整~~下载下来改个名字可以直接用~
  • 学生学籍管理系统学生学籍管理系统学生学籍管理系统学生学籍管理系统学生学籍管理系统学生学籍管理系统学生学籍管理系统学生学籍管理系统学生学籍管理系统学生学籍管理系统学生学籍管理系统学生学籍管理系统学生学籍...
  • txtsql = txtsql & "student_id and student_name= '" & txtname.Text & "'
  • 学生学籍管理系统学生学籍管理系统学生学籍管理系统学生学籍管理系统
  • 全国中小学生学籍信息离线管理工具是一款面向全国中小学生学籍信息管理系统的辅助管理软件,可以通过导入全国中小学生学籍信息管理系统生成的在校生信息(格式为csv或xls),离
  • 学生学籍管理系统

    千次阅读 多人点赞 2018-10-30 14:56:04
    学生学籍管理系统(基于文件操作) 主要实现的功能 添加学生学籍 删除学生学籍 修改学生学籍 查看学生学籍 显示学生学籍(以表格形式显示) 对学生学号进行排序 登入检验,判断进入的是学生界面还是管理员界面 统计...

    学生学籍管理系统(基于文件操作)

    主要实现的功能

    1. 添加学生学籍
    2. 删除学生学籍
    3. 修改学生学籍
    4. 查看学生学籍
    5. 显示学生学籍(以表格形式显示)
    6. 对学生学号进行排序
    7. 登入检验,判断进入的是学生界面还是管理员界面
    8. 统计学生总人数

    界面展示
    登录界面
    操作界面
    添加界面
    删除界面
    查找界面
    用户

    public class Account {
    	String id;
    	String password;
    	public Account(String id, String password){
    		this.id=id;
    		this.password=password;
    	}
    }
    

    学生信息

    public class Student {
    	int id;
    	String name;
    	int age;
    	String sex;
    	String yx;
    	String p;
    	String zy;
    	String cla;
    	String bz;
    	public Student() {}
    	public int getId() {
    		return id;
    	}
    	public void setId(int id) {
    		this.id = id;
    	}
    	public String getName() {
    		return name;
    	}
    	public void setName(String name) {
    		this.name = name;
    	}
    	public int getAge() {
    		return age;
    	}
    	public void setAge(int age) {
    		this.age = age;
    	}
    	public String getSex() {
    		return sex;
    	}
    	public void setSex(String sex) {
    		this.sex = sex;
    	}
    	public String getYx() {
    		return yx;
    	}
    	public void setYx(String yx) {
    		this.yx = yx;
    	}
    	public String getP() {
    		return p;
    	}
    	public void setP(String p) {
    		this.p = p;
    	}
    	public String getZy() {
    		return zy;
    	}
    	public void setZy(String zy) {
    		this.zy = zy;
    	}
    	public String getCla() {
    		return cla;
    	}
    	public void setCla(String cla) {
    		this.cla = cla;
    	}
    	public String getBz() {
    		return bz;
    	}
    	public void setBz(String bz) {
    		this.bz = bz;
    	}
    }
    

    Database

    public class Database {
    	//定义一个ArrayList容器,容器元素的类型定义为父类Item类型。
    	private ArrayList<Student> stu;
    	public Database(){
    		//只创建一个Arraylist对象。
    		stu = new ArrayList<Student>();	
    	}
    	public int size(){
    		return this.stu.size();
    	}
    	public Student get(int index){
    		return this.stu.get(index);
    	}
    	
    	/**
    	 * 添加信息。
    	 */
    	public void addItem(Student theItem){
    		stu.add(theItem);
    	}
    	/**
    	 * 修改信息。
    	 */
    	public void addItem(int index,Student item){
    		stu.set(index,item);
    	}
    	/**
    	 * 删除信息。
    	 */
    	public Student delet(int index){
    		return stu.remove(index);
    	}
    	/**
    	 * 列表显示当前所有CD和DVD的信息。
    	 */
    }
    

    登录界面

    public class LoginGui{
    	private JFrame frame;
    	private JLabel user,password,title;//p4包括确认密码时的输入框;点击register按钮出现
    	private JTextField users;
    	private JTextField passwords;
    	private JButton log,cannel;
    	Boolean m1=false;
    	Boolean m2=false;
    	public LoginGui(){
    		makeframe();
    	}
    	public void makeframe(){
    		frame = new JFrame("欢迎使用");
    		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    		frame.setLayout(null);
    		
    		title=new JLabel("学生学籍管理系统");
    		title.setFont(new Font("楷体", Font.BOLD, 30));
    		title.setForeground(Color.CYAN);
    		title.setBounds(39, 20, 350, 30);
    		frame.add(title);
    		
    		user = new JLabel("用户名");
    		user.setFont(new Font("微软雅黑", 0, 14));
    		user.setForeground(Color.BLACK);
    		user.setBounds(30, 80, 50, 30);
    		frame.add(user);
    		
    		users = new JTextField(10);
    		users.setBounds(120, 80, 180, 25);
    		frame.add(users);
    		
    		password = new JLabel("密码"); 
    		password.setFont(new Font("微软雅黑", 0, 14));
    		password.setForeground(Color.BLACK);
    		password.setBounds(30, 120, 50, 30);
    		frame.add(password);
    
    		passwords = new JPasswordField(10);
    		passwords.setBounds(120, 120, 180, 25);
    		frame.add(passwords);
    		
    		log = new JButton("登录");
    		log.setBorder(BorderFactory.createEtchedBorder(Color.BLUE, Color.YELLOW));
    		log.setBounds(20, 180, 130, 30);
    		frame.add(log);
    		log.addActionListener(new ActionListener() {
    			
    			@Override
    			public void actionPerformed(ActionEvent e) {
    				// TODO Auto-generated method stub
    				try {
    					String id=users.getText();
    					String psw=passwords.getText();
    					int c=Integer.parseInt(psw);
    					int a=c%10;
    					FileReader fr = new FileReader("stu.txt");
    					BufferedReader br = new BufferedReader(fr);
    					String str=br.readLine();
    					while(str!=null) {
    						String regex="\\s";
    						String[] s=str.split(regex);
    						int b=Integer.parseInt(s[1]);
    						if(id.equals(s[0])&&a==b) {
    							MenuStu ms=new MenuStu();
    							frame.setVisible(false);
    							JOptionPane.showMessageDialog(null,"登入成功");
    							m1=true;
    							break;
    						}else if(id.equals(s[0])&&psw.equals(s[1])){							
    							Menu menu=new Menu();
    							frame.setVisible(false);
    							JOptionPane.showMessageDialog(null,"登入成功");
    							m2=true;
    							break;
    						}
    						str=br.readLine();
    					}
    					if(m1&&m2) {
    						JOptionPane.showMessageDialog(frame,"查无此人");						
    					}
    				} catch (FileNotFoundException e1) {
    					// TODO Auto-generated catch block
    					e1.printStackTrace();
    				} catch (IOException e1) {
    					// TODO Auto-generated catch block
    					e1.printStackTrace();
    				} 
    			}
    		});
    		
    		cannel = new JButton("取消");
    		cannel.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED, Color.BLUE, Color.black));
    		cannel.setBounds(190,180, 130, 30);
    		cannel.addActionListener(new ActionListener() {
    			@Override
    			public void actionPerformed(ActionEvent arg0) {
    				// TODO Auto-generated method stub
    				System.exit(0);
    			}	
    		});
    		frame.add(cannel);
    		
    		ImageIcon img = new ImageIcon("11.jpg");
    		JLabel jl = new JLabel(img); 
    		jl.setBounds(2, -70,330,370);
    		frame.add(jl);
    		
    		frame.setIconImage(Toolkit.getDefaultToolkit().createImage("12.png"));
    		frame.setSize(350, 270);//设置大小
    		frame.setVisible(true);
    		Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
    		frame.setLocation(d.width/2-frame.getWidth()/2,d.height/2-frame.getHeight()/2);
    	}
    }
    

    学生菜单界面

    public class MenuStu {
    public JFrame mframe;
    private JLabel mp,d,t;
    private JButton add;
    private JButton check;
    private JButton Alter;
    private JButton exit;
    public MenuStu(){
    makeframe();
    }
    public void makeframe(){
    mframe = new JFrame(“菜单”);
    mframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    mframe.setLayout(null);
    
    	mp=new JLabel("学生界面请选择操作项目");
    	mp.setFont(new Font("楷体", Font.BOLD, 20));
    	mp.setForeground(Color.CYAN);
    	mp.setBounds(220, 5, 350, 20);
    	mframe.add(mp);
    	
    	add=new JButton("录入");
    	add.setBorder(BorderFactory.createRaisedBevelBorder());
    	add.setBounds(20, 50, 100, 30);
    	mframe.add(add);
    	add.addActionListener(new ActionListener() {
    		
    		@Override
    		public void actionPerformed(ActionEvent e) {
    			// TODO Auto-generated method stub
    			new Addstu();
    		}
    	});
    	
    	check=new JButton("查询");
    	check.setBorder(BorderFactory.createRaisedBevelBorder());
    	check.setBounds(515, 50, 100, 30);
    	mframe.add(check);
    	check.addActionListener(new ActionListener() {
    		
    		@Override
    		public void actionPerformed(ActionEvent e) {
    			// TODO Auto-generated method stub
    			new FindStu();
    		}
    	});
    	
    	Alter=new JButton("修改");
    	Alter.setBorder(BorderFactory.createRaisedBevelBorder());
    	Alter.setBounds(20, 120, 100, 30);
    	mframe.add(Alter);
    	Alter.addActionListener(new ActionListener() {
    		
    		@Override
    		public void actionPerformed(ActionEvent e) {
    			// TODO Auto-generated method stub
    			new AlterStu();
    		}
    	});
    	
    	Date currentTime;
    	SimpleDateFormat formatter;//进行格式化(日期 -> 文本)、解析(文本 -> 日期)和规范化。
    	formatter=new SimpleDateFormat("yy-MM-dd HH:mm:ss");//时间格式
    	currentTime= new Date();//当前时间
    	String dateString=formatter.format(currentTime);
    	d=new JLabel("当前时间:");
    	d.setFont(new Font("楷体", Font.BOLD, 15));
    	d.setForeground(Color.BLACK);
    	d.setBounds(20, 300, 350, 15);
    	mframe.add(d);
    	t=new JLabel(dateString);
    	t.setFont(new Font("楷体", Font.BOLD, 15));
    	t.setForeground(Color.BLACK);
    	t.setBounds(100, 300, 350, 15);
    	mframe.add(t);
    	
    	exit=new JButton("退出");
    	exit.setBorder(BorderFactory.createRaisedBevelBorder());
    	exit.setBounds(515, 300, 100, 30);
    	mframe.add(exit);
    	exit.addActionListener(new ActionListener() {
    		
    		@Override
    		public void actionPerformed(ActionEvent e) {
    			// TODO Auto-generated method stub
    			new LoginGui();
    			mframe.setVisible(false);//隐藏
    			JOptionPane.showMessageDialog(null,"成功退出");
    		}
    	});
    	
    	ImageIcon img = new ImageIcon("11.jpg");
    	JLabel jl = new JLabel(img); 
    	jl.setBounds(0, -50,650	,450);
    	mframe.add(jl);
    	
    	mframe.setSize(650, 390);
    	mframe.setVisible(true);
    	Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
    	mframe.setLocation(d.width/2-mframe.getWidth()/2,d.height/2-mframe.getHeight()/2);
    }
    }
    

    管理员界面

    public class Menu{
    	public JFrame mframe;
    	private JLabel mp,d,t;
    	private JButton add;
    	private JButton check;
    	private JButton delete;
    	private JButton Alter;
    	private JButton exit;
    	private JButton sum;
    	private JButton view;
    	public Menu(){
    		makeframe();
    	}
    	public void makeframe(){
    		mframe = new JFrame("菜单");
    		mframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    		mframe.setLayout(null);
    		
    		mp=new JLabel("管理员界面请选择操作项目");
    		mp.setFont(new Font("楷体", Font.BOLD, 20));
    		mp.setForeground(Color.CYAN);
    		mp.setBounds(220, 5, 350, 20);
    		mframe.add(mp);
    		
    		add=new JButton("录入");
    		add.setBorder(BorderFactory.createRaisedBevelBorder());
    		add.setBounds(20, 50, 100, 30);
    		mframe.add(add);
    		add.addActionListener(new ActionListener() {
    			
    			@Override
    			public void actionPerformed(ActionEvent e) {
    				// TODO Auto-generated method stub
    				new Addstu();
    			}
    		});
    		
    		check=new JButton("查询");
    		check.setBorder(BorderFactory.createRaisedBevelBorder());
    		check.setBounds(515, 50, 100, 30);
    		mframe.add(check);
    		check.addActionListener(new ActionListener() {
    			
    			@Override
    			public void actionPerformed(ActionEvent e) {
    				// TODO Auto-generated method stub
    				new FindStu();
    			}
    		});
    		
    		delete=new JButton("删除");
    		delete.setBorder(BorderFactory.createRaisedBevelBorder());
    		delete.setBounds(20, 120, 100, 30);
    		mframe.add(delete);
    		delete.addActionListener(new ActionListener() {
    			
    			@Override
    			public void actionPerformed(ActionEvent e) {
    				// TODO Auto-generated method stub
    				new DelStu();
    			}
    		});
    		
    		Alter=new JButton("修改");
    		Alter.setBorder(BorderFactory.createRaisedBevelBorder());
    		Alter.setBounds(515, 120, 100, 30);
    		mframe.add(Alter);
    		Alter.addActionListener(new ActionListener() {
    			
    			@Override
    			public void actionPerformed(ActionEvent e) {
    				// TODO Auto-generated method stub
    				new AlterStu();
    			}
    		});
    		
    		sum=new JButton("总人数");
    		sum.setBorder(BorderFactory.createRaisedBevelBorder());
    		sum.setBounds(20, 190, 100, 30);
    		mframe.add(sum);
    		sum.addActionListener(new ActionListener() {
    			
    			@Override
    			public void actionPerformed(ActionEvent e) {
    				// TODO Auto-generated method stub
    				new Sum();
    			}
    		});
    
    		Date currentTime;
    		SimpleDateFormat formatter;//进行格式化(日期 -> 文本)、解析(文本 -> 日期)和规范化。
    		formatter=new SimpleDateFormat("yy-MM-dd HH:mm:ss");//时间格式
    		currentTime= new Date();//当前时间
    		String dateString=formatter.format(currentTime);
    		d=new JLabel("当前时间:");
    		d.setFont(new Font("楷体", Font.BOLD, 15));
    		d.setForeground(Color.BLACK);
    		d.setBounds(20, 300, 350, 15);
    		mframe.add(d);
    		t=new JLabel(dateString);
    		t.setFont(new Font("楷体", Font.BOLD, 15));
    		t.setForeground(Color.BLACK);
    		t.setBounds(100, 300, 350, 15);
    		mframe.add(t);
    		
    		view=new JButton("查看");
    		view.setBorder(BorderFactory.createRaisedBevelBorder());
    		view.setBounds(515, 190, 100, 30);
    		mframe.add(view);
    		view.addActionListener(new ActionListener() {
    			
    			@Override
    			public void actionPerformed(ActionEvent e) {
    				// TODO Auto-generated method stub
    				new View();
    			}
    		});
    		
    		exit=new JButton("退出");
    		exit.setBorder(BorderFactory.createRaisedBevelBorder());
    		exit.setBounds(515, 300, 100, 30);
    		mframe.add(exit);
    		exit.addActionListener(new ActionListener() {
    			
    			@Override
    			public void actionPerformed(ActionEvent e) {
    				// TODO Auto-generated method stub
    				new LoginGui();
    				mframe.setVisible(false);//隐藏
    				JOptionPane.showMessageDialog(null,"成功退出");
    			}
    		});
    		
    		ImageIcon img = new ImageIcon("11.jpg");
    		JLabel jl = new JLabel(img); 
    		jl.setBounds(0, -50,650	,450);
    		mframe.add(jl);
    		
    		mframe.setSize(650, 390);
    		mframe.setVisible(true);
    		Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
    		mframe.setLocation(d.width/2-mframe.getWidth()/2,d.height/2-mframe.getHeight()/2);
    	}
    }
    

    添加学生学籍

    public class Addstu{
    	private JFrame frame;
    	private JTextField idtext;
    	private JTextField nametext;
    	private JTextField agetext;
    	private JComboBox zytext;
    	private JTextField clatext;
    	private JComboBox settext;
    	private JComboBox ptext;
    	private	JTextArea text;
    	private Writer fw;
    	private Writer fw1;
    	private BufferedReader br;
    	private FileReader fr;
    	String str1;
    	boolean check=false;
    	boolean n=false;
    	boolean b=false;
    	public Addstu(){
    		Date currentTime;
    		SimpleDateFormat formatter;//进行格式化(日期 -> 文本)、解析(文本 -> 日期)和规范化。
    		formatter=new SimpleDateFormat("yyyy-MM-dd\\HH:mm:ss");//时间格式
    		currentTime= new Date();//当前时间
    		String dateString=formatter.format(currentTime);
    		makeframe();
    		JButton ok=new JButton("确定");
    		ok.setBounds(35, 320, 100, 25);
    		frame.add(ok);
    		JButton cancel=new JButton("取消");
    		cancel.setBounds(200, 320, 100, 25);
    		frame.add(cancel);
    		ok.addActionListener(new ActionListener() {
    			public void actionPerformed(ActionEvent e) {
    				try{
    					String str=idtext.getText();
    					String strage=agetext.getText();
    					fr = new FileReader(StuFrame.file);
    					br = new BufferedReader(fr);
    					str1=br.readLine();
    					while(str1!=null) {
    						b=true;
    						String regex="\\s";
    						String regex1="201\\d{7}";
    						String regex2="\\d{1,2}";
    						String[] s=str1.split(regex);
    						if(str.matches(regex1)&&strage.matches(regex2)) {
    							if(str.equals(s[0])) {
    								JOptionPane.showMessageDialog(null,"学号相同,录入失败");
    								break;
    							}else {
    								try{
    									int a=Integer.parseInt(str)%10;
    									fw = new FileWriter(StuFrame.file,true);
    									fw.append(idtext.getText()+"\t"+
    											nametext.getText()+"\t"+
    											agetext.getText()+"\t"+
    											settext.getSelectedItem()+"\t"+
    											ptext.getSelectedItem()+"\t"+
    											zytext.getSelectedItem()+"\t"+
    											clatext.getText()+"\t"+
    											text.getText()+"\t"+
    											dateString+"\n");
    									fw1 = new FileWriter("stu.txt",true);
    									fw1.append(str+" "+a+"\n");	
    									JOptionPane.showMessageDialog(frame,"录入成功");
    									check=true;
    									n=true;
    								}catch(Exception e1){
    									
    								}finally {
    									try {	
    										fw1.close();
    										fw.close();															
    									} catch (IOException e1) {
    										System.out.println("错误");
    									}
    								}
    							}
    							if(check) {
    								str1=null;
    							}else {
    								str1=br.readLine();							
    							}
    						}else {
    							JOptionPane.showMessageDialog(null,"学号输入有误");
    							break;
    						}
    					}
    					if(!b) {
    						String regex1="201\\d{7}";
    						String regex2="\\d{1,2}";
    						if(str.matches(regex1)) {
    							if(strage.matches(regex2)) {
    								int a=Integer.parseInt(str)%10;
    								fw = new FileWriter(StuFrame.file,true);
    								fw.append(idtext.getText()+"\t"+
    										nametext.getText()+"\t"+
    										agetext.getText()+"\t"+
    										settext.getSelectedItem()+"\t"+
    										ptext.getSelectedItem()+"\t"+
    										zytext.getSelectedItem()+"\t"+
    										clatext.getText()+"\t"+
    										text.getText()+"\t"+
    										dateString+"\n");
    								fw1 = new FileWriter("stu.txt",true);
    								fw1.append(str+" "+a+"\n");
    								JOptionPane.showMessageDialog(frame,"录入成功");
    								check=true;
    							}
    						}else {
    							JOptionPane.showMessageDialog(null,"学号输入有误");
    						}
    					}
    				}catch(Exception e1){
    				}finally {
    					try {
    						fw.close();
    						fw1.close();
    						br.close();															
    					} catch (Exception e1) {
    						System.out.println("");
    					}
    				}
    			}
    		});
    		cancel.addActionListener(new ActionListener() {
    			
    			@Override
    			public void actionPerformed(ActionEvent e) {
    				// TODO Auto-generated method stub
    				frame.setVisible(false);
    			}
    		});
    	}
    	
    	public static void main(String[] args) {
    		new Addstu();
    	}
    	public void makeframe() {
    		
    		frame=new JFrame("添加信息");
    		frame.setLayout(null);
    		
    		idtext=new JTextField();
    		idtext.setBounds(100, 20, 200, 25);
    		frame.add(idtext);
    		JLabel id=new JLabel();
    		id.setText("学号:");
    		id.setBounds(40, 18, 120, 30);
    		frame.add(id);
    		
    		nametext=new JTextField(20);
    		nametext.setBounds(380, 20, 200, 25);
    		frame.add(nametext);
    		JLabel name=new JLabel();
    		name.setText("姓名:");
    		name.setBounds(330, 18, 120, 30);
    		frame.add(name);
    		
    		agetext=new JTextField(20);
    		agetext.setBounds(100, 60, 200, 25);
    		frame.add(agetext);
    		JLabel age=new JLabel();
    		age.setText("年龄:");
    		age.setBounds(40, 60, 120, 30);
    		frame.add(age);
    		
    		JLabel sex=new JLabel();
    		sex.setText("性别:");
    		sex.setBounds(330, 60, 120, 30);
    		frame.add(sex);
    		String[] ranks= {"男","女"};
    		settext=new JComboBox(ranks);
    		settext.setBounds(380, 60, 200, 25);
    		frame.add(settext);
    		
    		JLabel p=new JLabel();
    		p.setText("政治面貌:");
    		p.setBounds(330, 100, 120, 30);
    		frame.add(p);
    		String[] ps= {"共青团员","党员","群众","其他"};
    		ptext=new JComboBox(ps);
    		ptext.setBounds(400, 100, 180, 25);
    		frame.add(ptext);
    		
    		String[] zys= {"软件工程","网络工程","物联网工程","通信工程"};
    		zytext=new JComboBox(zys);
    		zytext.setBounds(100, 140, 200, 25);
    		frame.add(zytext);
    		JLabel zy=new JLabel();
    		zy.setText("专业:");
    		zy.setBounds(40, 140, 100, 30);
    		frame.add(zy);
    		
    		clatext=new JTextField(20);
    		clatext.setBounds(380, 140, 200, 25);
    		frame.add(clatext);
    		JLabel cla=new JLabel();
    		cla.setText("班级:");
    		cla.setBounds(330, 140, 200, 30);
    		frame.add(cla);
    		
    		text=new JTextArea();
    		text.setBounds(100, 180, 480, 100);
    		frame.add(text);
    		JLabel bz=new JLabel();
    		bz.setText("备注:");
    		bz.setBounds(40, 180, 100, 30);
    		frame.add(bz);
    
    		frame.setSize(650, 390);
    		Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
    		frame.setLocation(d.width / 2 - frame.getWidth() / 2, d.height / 2- frame.getHeight() / 2);
    		frame.setVisible(true);
    	}
    }
    

    删除学生学籍

    public class DelStu {
    	private JFrame frame;
    	private JLabel title;//p4包括确认密码时的输入框;点击register按钮出现
    	private JTextField idt;
    	private JButton log,cancel;
    	private FileReader fr; 
    	private BufferedReader br;
    	private Writer fw;
    	static String refile;
    	private boolean check=false;
    	
    	public DelStu(){
    		makeframe();
    		refile=StuFrame.file+"1";
    		File users=new File(refile);
    		if(!users.exists()){
    			try{
    				users.createNewFile();
    			}catch(Exception e1){
    				JOptionPane.showMessageDialog(null,"创建用户文档失败");
    			}
    		}
    	}
    	public void makeframe(){
    		Date currentTime;
    		SimpleDateFormat formatter;//进行格式化(日期 -> 文本)、解析(文本 -> 日期)和规范化。
    		formatter=new SimpleDateFormat("yyyy-MM-dd\\HH:mm:ss");//时间格式
    		currentTime= new Date();//当前时间
    		String dateString=formatter.format(currentTime);
    		frame = new JFrame("删除");
    		frame.setLayout(null);
    		
    		title=new JLabel("输入删除的学号:");
    		title.setFont(new Font("楷体", Font.BOLD, 20));
    		title.setForeground(Color.BLACK);
    		title.setBounds(50, 40, 200, 20);
    		frame.add(title);
    		idt = new JTextField(10);
    		idt.setBounds(100, 100, 140, 25);
    		frame.add(idt);
    
    		log = new JButton("删除");
    		log.setBorder(BorderFactory.createEtchedBorder(Color.BLUE, Color.YELLOW));
    		log.setBounds(105, 255, 130, 30);
    		frame.add(log);
    		log.addActionListener(new ActionListener() {
    					
    			@Override
    			public void actionPerformed(ActionEvent e) {
    				// TODO Auto-generated method stub
    				try {
    					String id=idt.getText();
    					fr=new FileReader(StuFrame.file);
    					System.out.println(StuFrame.file);
    					br=new BufferedReader(fr);
    					fw = new FileWriter(refile,true);
    					String str=br.readLine();
    					while(str!=null) {
    						String regex="\\s";
    						String[] s=str.split(regex);
    						str=br.readLine();
    						if(id.equals(s[0])) {
    							check=true;
    							continue;
    						}
    						try{
    							fw.append(s[0]+"\t"+s[1]+"\t"+s[2]+"\t"+s[3]+"\t"
    									+s[4]+"\t"+s[5]+"\t"+s[6]+"\t"+s[7]+"\t"
    									+s[8]+"\n");
    						}catch(Exception e1){
    							JOptionPane.showMessageDialog(null,"录入信息失败");
    						}finally {
    //							br.close();
    //							fr.close();
    						}
    					}
    					if(check) {
    						JOptionPane.showMessageDialog(frame,"删除成功");	
    						frame.setVisible(false);
    					}else {
    						JOptionPane.showMessageDialog(frame,"查看死否有此人,删除失败");
    						frame.setVisible(false);
    					}
    				} catch (FileNotFoundException e1) {
    					// TODO Auto-generated catch block
    					e1.printStackTrace();
    				} catch (IOException e1) {
    					// TODO Auto-generated catch block
    					e1.printStackTrace();
    				}finally {
    					try {
    						fw.close();						
    						fr.close();
    						br.close();
    						File file1=new File(StuFrame.file);
    						System.out.println(file1.delete());
    						File file2=new File("stulist.txt");
    						File file3=new File(refile);
    						System.out.println(file3.renameTo(file2));
    //						Addstu.file=refile;
    //						System.out.println(Addstu.file);
    					} catch (IOException e1) {
    						// TODO Auto-generated catch block
    						e1.printStackTrace();
    					}					
    				}
    			}
    		});
    	
    		cancel = new JButton("返回");
    		cancel.setBorder(BorderFactory.createEtchedBorder(Color.BLUE, Color.YELLOW));
    		cancel.setBounds(105, 300, 130, 30);
    		frame.add(cancel);
    		cancel.addActionListener(new ActionListener() {
    			
    			@Override
    			public void actionPerformed(ActionEvent e) {
    				// TODO Auto-generated method stub
    				frame.setVisible(false);
    			}
    		});
    		
    		frame.setSize(350, 400);
    		Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
    		frame.setLocation(d.width / 2 - frame.getWidth() / 2, d.height / 2- frame.getHeight() / 2);
    		frame.setVisible(true);	
    	}
    	public static void main(String[] args) {
    		new DelStu();
    	}
    }
    

    修改学生学籍

    public class AlterStu {
    	private JFrame frame;
    	private JLabel title;
    	private JTextField idt;
    	private JButton log;
    	private FileReader fr; 
    	private BufferedReader br;
    	private JTextField idtext;
    	private JTextField nametext;
    	private JTextField agetext;
    	private JTextField yxtext;
    	private JComboBox zytext;
    	private JTextField clatext;
    	private JComboBox settext;
    	private JComboBox ptext;
    	private	JTextArea text;
    	private Writer fw;
    	private Writer fw1;
    	static String dfile;
    	int index=0;
    	int sum=0;
    	int c=0;
    	public AlterStu(){
    		makeframe();
    		dfile=StuFrame.file+"2";
    	}
    	public void makeframe(){
    		Date currentTime;
    		SimpleDateFormat formatter;//进行格式化(日期 -> 文本)、解析(文本 -> 日期)和规范化。
    		formatter=new SimpleDateFormat("yyyy-MM-dd\\HH:mm:ss");//时间格式
    		currentTime= new Date();//当前时间
    		String dateString=formatter.format(currentTime);
    		frame = new JFrame("删除");
    		frame.setVisible(true);	
    		frame.setLayout(null);
    		
    		title=new JLabel("输入修改的学号:");
    		title.setForeground(Color.BLACK);
    		title.setBounds(150, 20, 200, 25);
    		frame.add(title);
    		idt = new JTextField(10);
    		idt.setBounds(255, 20, 140, 25);
    		frame.add(idt);
    
    		log = new JButton("search");
    		log.setBorder(BorderFactory.createEtchedBorder(Color.BLUE, Color.YELLOW));
    		log.setBounds(400, 20, 80, 25);
    		frame.add(log);
    		log.addActionListener(new ActionListener() {
    			
    			@Override
    			public void actionPerformed(ActionEvent e) {
    				// TODO Auto-generated method stub
    				try {
    					String id=idt.getText();
    					fr=new FileReader(StuFrame.file);
    					System.out.println(StuFrame.file);
    					br=new BufferedReader(fr);
    					String str=br.readLine();
    					while(str!=null) {
    						String regex="\\s";
    						String[] s=str.split(regex);
    						if(id.equals(s[0])) {
    							idtext.setText(s[0]);
    							nametext.setText(s[1]);
    							agetext.setText(s[2]);
    							settext.setSelectedItem(s[3]);
    							ptext.setSelectedItem(s[4]);
    							zytext.setSelectedItem(s[5]);
    							clatext.setText(s[6]);
    							text.setText(s[7]);
    						}
    						index++;
    						str=br.readLine();
    					}
    				} catch (FileNotFoundException e1) {
    					// TODO Auto-generated catch block
    					e1.printStackTrace();
    				} catch (IOException e1) {
    					// TODO Auto-generated catch block
    					e1.printStackTrace();
    				}finally {
    					try {
    						fr.close();
    						br.close();					
    					} catch (IOException e1) {
    						// TODO Auto-generated catch block
    						e1.printStackTrace();
    					}
    				}
    			}
    		});
    		
    		JButton ok=new JButton("确定");
    		ok.setBounds(50, 325, 100, 25);
    		frame.add(ok);
    		ok.addActionListener(new ActionListener() {
    			
    			@Override
    			public void actionPerformed(ActionEvent e) {
    				// TODO Auto-generated method stub
    				try{
    					fw = new FileWriter(StuFrame.file,true);
    					System.out.println(StuFrame.file);
    					fw.append(idtext.getText()+"\t"+
    							nametext.getText()+"\t"+
    							agetext.getText()+"\t"+
    							settext.getSelectedItem()+"\t"+
    							ptext.getSelectedItem()+"\t"+
    							zytext.getSelectedItem()+"\t"+
    							clatext.getText()+"\t"+
    							text.getText()+"\t"+
    							dateString+"\n");
    				}catch(Exception e1){
    					JOptionPane.showMessageDialog(null,"录入信息失败");
    				}finally {	
    					try {
    						fw.close();
    					} catch (IOException e1) {
    						// TODO Auto-generated catch block
    						e1.printStackTrace();
    					}
    				}
    				try {
    					fr=new FileReader(StuFrame.file);
    					br=new BufferedReader(fr);
    					fw1 = new FileWriter(dfile,true);
    					String str=br.readLine();
    					while(str!=null) {
    						sum++;
    						String regex="\\s";
    						String[] s=str.split(regex);
    						str=br.readLine();
    						if(index==sum) {
    							continue;
    						}
    						try{
    							fw1.append(s[0]+"\t"+s[1]+"\t"+s[2]+"\t"+s[3]+"\t"+
    									s[4]+"\t"+s[5]+"\t"+s[6]+"\t"+s[7]+"\t"+dateString+"\n");
    						}catch(Exception e1){
    							JOptionPane.showMessageDialog(null,"修改失败");
    						}finally {
    						}
    					}
    //					JOptionPane.showMessageDialog(null,"修改成功");
    				} catch (FileNotFoundException e1) {
    					// TODO Auto-generated catch block
    					e1.printStackTrace();
    				} catch (IOException e1) {
    					// TODO Auto-generated catch block
    					e1.printStackTrace();
    				}finally {					
    					try {
    						fw1.close();							
    						br.close();
    						fr.close();
    					} catch (IOException e1) {
    						// TODO Auto-generated catch block
    						e1.printStackTrace();
    					}
    				}
    				JOptionPane.showMessageDialog(frame,"修改成功");
    				File file1=new File(StuFrame.file);
    				System.out.println(file1.delete());
    				File file2=new File("stulist.txt");
    				File file3=new File(dfile);
    				System.out.println(dfile);
    				System.out.println(file3.renameTo(file2));
    //				Addstu.file=dfile;
    			}
    		});
    		JButton cancel=new JButton("取消");
    		cancel.setBounds(460, 325, 100, 25);
    		frame.add(cancel);
    		cancel.addActionListener(new ActionListener() {
    			
    			@Override
    			public void actionPerformed(ActionEvent e) {
    				// TODO Auto-generated method stub
    				frame.setVisible(false);
    			}
    		});
    		
    		idtext=new JTextField();
    		idtext.setBounds(100, 60, 200, 25);
    		frame.add(idtext);
    		JLabel id=new JLabel();
    		id.setText("学号:");
    		id.setBounds(40, 60, 120, 30);
    		frame.add(id);
    		
    		nametext=new JTextField(20);
    		nametext.setBounds(380, 60, 200, 25);
    		frame.add(nametext);
    		JLabel name=new JLabel();
    		name.setText("姓名:");
    		name.setBounds(330, 60, 120, 30);
    		frame.add(name);
    		
    		agetext=new JTextField(20);
    		agetext.setBounds(100, 100, 200, 25);
    		frame.add(agetext);
    		JLabel age=new JLabel();
    		age.setText("年龄:");
    		age.setBounds(40, 100, 120, 30);
    		frame.add(age);
    		
    		JLabel sex=new JLabel();
    		sex.setText("性别:");
    		sex.setBounds(330, 100, 120, 30);
    		frame.add(sex);
    		String[] ranks= {"男","女"};
    		settext=new JComboBox(ranks);
    		settext.setBounds(380, 100, 200, 25);
    		frame.add(settext);
    		
    		JLabel p=new JLabel();
    		p.setText("政治面貌:");
    		p.setBounds(330, 140, 120, 30);
    		frame.add(p);
    		String[] ps= {"共青团员","党员","群众","其他"};
    		ptext=new JComboBox(ps);
    		ptext.setBounds(400, 140, 180, 25);
    		frame.add(ptext);
    		
    		String[] zys= {"软件工程","网络工程","物联网工程","通信工程"};
    		zytext=new JComboBox(zys);
    		zytext.setBounds(100, 180, 200, 25);
    		frame.add(zytext);
    		JLabel zy=new JLabel();
    		zy.setText("专业:");
    		zy.setBounds(40, 180, 100, 30);
    		frame.add(zy);
    		
    		clatext=new JTextField(20);
    		clatext.setBounds(380, 180, 200, 25);
    		frame.add(clatext);
    		JLabel cla=new JLabel();
    		cla.setText("班级:");
    		cla.setBounds(330, 180, 200, 30);
    		frame.add(cla);
    		
    		text=new JTextArea();
    		text.setBounds(100, 220, 480, 100);
    		frame.add(text);
    		JLabel bz=new JLabel();
    		bz.setText("备注:");
    		bz.setBounds(40, 220, 100, 30);
    		frame.add(bz);
    		
    		frame.setSize(650, 390);
    		Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
    		frame.setLocation(d.width / 2 - frame.getWidth() / 2, d.height / 2- frame.getHeight() / 2);
    	}
    	public static void main(String[] args) {
    		new AlterStu();
    	}
    }
    

    查询学生学籍

    public class FindStu {
    	private JFrame frame;
    	private JLabel title;
    	private JTextField idt;
    	private JTextArea find;
    	private JButton log,cancel;
    	private FileReader fr; 
    	private BufferedReader br;
    	boolean check;
    	public FindStu(){
    		makeframe();
    	}
    		public void makeframe(){
    		frame = new JFrame("查找");
    		frame.setLayout(null);
    		
    		title=new JLabel("输入学号:");
    		title.setFont(new Font("楷体", Font.BOLD, 20));
    		title.setForeground(Color.BLACK);
    		title.setBounds(28, 20, 150, 20);
    		frame.add(title);
    		idt = new JTextField(10);
    		idt.setBounds(140, 19, 140, 25);
    		frame.add(idt);
    		
    		find=new JTextArea();
    		find.setBounds(10, 50, 315, 250);
    		frame.add(find);
    		
    		log = new JButton("查找");
    		log.setBorder(BorderFactory.createEtchedBorder(Color.BLUE, Color.YELLOW));
    		log.setBounds(25, 305, 130, 30);
    		frame.add(log);
    		log.addActionListener(new ActionListener() {
    			
    			@Override
    			public void actionPerformed(ActionEvent e) {
    				// TODO Auto-generated method stub
    				try {
    					int sum=0;
    					String id=idt.getText();
    					fr=new FileReader(StuFrame.file);
    					br=new BufferedReader(fr);
    					String str=br.readLine();
    					check=false;
    					while(str!=null) {
    						sum++;
    						String regex="\\s";
    						String[] s=str.split(regex);
    						if(id.equals(s[0])) {
    							String str1="学号:\t"+s[0]+"\n"+
    										"姓名:\t"+s[1]+"\n"+
    										"年龄:\t"+s[2]+"\n"+
    										"性别:\t"+s[3]+"\n"+
    										"政治面貌:\t"+s[4]+"\n"+
    										"专业:\t"+s[5]+"\n"+
    										"班级:\t"+s[6]+"\n"+
    										"备注:\\t"+s[7]+"\n"+
    										"添加的时间:"+s[8]+"\n";
    							find.setText(str1);	
    							check=true;
    						}
    						str=br.readLine();
    					}
    				} catch (FileNotFoundException e1) {
    					// TODO Auto-generated catch block
    					System.out.println("还没有添加学生学籍");
    				} catch (IOException e1) {
    					// TODO Auto-generated catch block
    					e1.printStackTrace();
    				} finally {
    					try {
    						br.close();
    					} catch (IOException e1) {
    						// TODO Auto-generated catch block
    						e1.printStackTrace();
    					}
    				}
    				if(!check) {						
    					JOptionPane.showMessageDialog(frame,"查无此人");
    				}
    			}
    		});
    		
    		cancel = new JButton("返回");
    		cancel.setBorder(BorderFactory.createEtchedBorder(Color.BLUE, Color.YELLOW));
    		cancel.setBounds(180, 305, 130, 30);
    		frame.add(cancel);
    		cancel.addActionListener(new ActionListener() {
    			
    			@Override
    			public void actionPerformed(ActionEvent e) {
    				// TODO Auto-generated method stub
    				frame.setVisible(false);
    			}
    		});
    		
    		frame.setSize(350, 400);
    		Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
    		frame.setLocation(d.width / 2 - frame.getWidth() / 2, d.height / 2- frame.getHeight() / 2);
    		frame.setVisible(true);
    	}
    		public static void main(String[] args) {
    			new FindStu();
    		}
    }
    

    显示学生学籍

    public class View {
    	private JFrame frame;
    	public static Database db;
    	private JTextArea find;
    	private JButton cancel;
    	private FileReader fr; 
    	private BufferedReader br;
    	private DefaultTableModel model;
    	private JTable table;
    	private JScrollPane scr;
    	public View(){
    		makeframe();
    		makeModel();
    		makeTable();
    	}
    	private void makeTable() {
    		makeModel();
    		this.table = new JTable(model);
    		this.scr = new JScrollPane(this.table);
    	
    	}
    		public void makeframe(){
    			frame = new JFrame("查看");
    			frame.setLayout(null);
    		cancel = new JButton("返回");
    		cancel.setBorder(BorderFactory.createEtchedBorder(Color.BLUE, Color.YELLOW));
    		cancel.setBounds(240, 305, 130, 30);
    		frame.add(cancel);
    		cancel.addActionListener(new ActionListener() {
    			
    			@Override
    			public void actionPerformed(ActionEvent e) {
    				// TODO Auto-generated method stub
    				frame.setVisible(false);
    			}
    		});
    		
    		frame.setSize(650, 390);
    		Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
    		frame.setLocation(d.width / 2 - frame.getWidth() / 2, d.height / 2- frame.getHeight() / 2);
    		frame.setVisible(true);
    	}
    		private void makeModel() {
    			String[] titles = { "学号", "姓名", "年龄", "性别","院系","政治面貌","专业","班级","备注" };
    			System.out.println(db.size());
    			Object[][] info = new Object[db.size()][titles.length];
    			for (int i = 0; i < db.size(); i++) {
    				Student data = db.get(i);
    				info[i][0] = data.getId();
    				info[i][1] = data.getName();
    				info[i][2] = data.getAge();
    				info[i][3] = data.getSex();
    				info[i][4] = data.getYx();
    				info[i][5] = data.getP();
    				info[i][6] = data.getZy();
    				info[i][7] = data.getCla();
    				info[i][8] = data.getBz();
    			}
    			this.model = new DefaultTableModel(info, titles);
    		}
    		public static void main(String[] args) {
    			new View();
    		}
    }
    

    查看学生总人数

    public class Sum {
    	JFrame frame;
    	JLabel p,p1;
    	BufferedReader br;
    	FileReader fr;
    	int sum=0;
    	public Sum(){
    		makeframe();
    	}
    	public void makeframe(){
    		frame = new JFrame("总人数");
    		frame.setSize(200, 200);
    		frame.setVisible(true);
    		Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
    		frame.setLocation(d.width / 2 - frame.getWidth() / 2, d.height / 2- frame.getHeight() / 2);
    		try {
    			fr = new FileReader(StuFrame.file);
    			br = new BufferedReader(fr);
    			String str1=br.readLine();
    			while(str1!=null) {
    				sum++;
    				str1=br.readLine();
    			}
    		} catch (FileNotFoundException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		} catch (IOException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		}finally {
    			try {
    				fr.close();
    				br.close();
    			} catch (IOException e) {
    				// TODO Auto-generated catch block
    				e.printStackTrace();
    			}
    		}
    		
    		p=new JLabel("总人数:"+sum);
    		p.setFont(new Font("楷体", Font.BOLD, 20));
    		p.setForeground(Color.BLACK);
    		p.setBounds(220, 30, 350, 20);
    		frame.add(p);
    	}
    }
    

    测试

    public class StuFrame {
    	public static ArrayList<Account> usersList;
    	public static Reader fw;
    	static File user;
    	static String file="stulist.txt";
    	
    	public static void main(String[] args)throws Exception{
    		try {
    			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    		} catch (Exception e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		} 
    		usersList=new ArrayList<Account>();
    		File users=new File("stu.txt");
    		if(!users.exists()){
    			try{
    				users.createNewFile();
    				Writer fw = new FileWriter("stu.txt");
    				fw.write("admin 12345"+"\n");
    				fw.flush();
    				fw.close();
    			}catch(Exception e1){
    				JOptionPane.showMessageDialog(null,"创建用户文档失败");
    			}
    		}
    		usersListRead();
    		user=new File(file);
    		if(!user.exists()){
    			try{
    				user.createNewFile();
    			}catch(Exception e1){
    				JOptionPane.showMessageDialog(null,"创建用户文档失败");
    			}
    		}
    		//Login
    		LoginGui loginGui=new LoginGui();
    	}
    	public static void usersListRead(){
    		try{
    			fw=new FileReader("stu.txt");//字符流
    		}catch(Exception e){
    			System.out.println("字符流创建失败");
    		}
    		BufferedReader bfr=new BufferedReader(fw);
    		String temp;
    		try{
    			//System.out.println("开始写入list");
    			while((temp=bfr.readLine())!=null){
    				String[] tmpstr=temp.split("\\s+");//分割空格
    				Account a=new Account(tmpstr[0],tmpstr[1]);
    				usersList.add(a);
    			}
    			bfr.close();
    			fw.close();
    		}catch(Exception e){
    			System.out.println("读取用户文档失败");
    		}
    	}
    }
    

    public class StuFrame {
    public static ArrayList usersList;
    public static Reader fw;
    static File user;
    static String file=“stulist.txt”;

    public static void main(String[] args)throws Exception{
    	try {
    		UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    	} catch (Exception e) {
    		// TODO Auto-generated catch block
    		e.printStackTrace();
    	} 
    	usersList=new ArrayList<Account>();
    	File users=new File("stu.txt");
    	if(!users.exists()){
    		try{
    			users.createNewFile();
    			Writer fw = new FileWriter("stu.txt");
    			fw.write("admin 12345"+"\n");
    			fw.flush();
    			fw.close();
    		}catch(Exception e1){
    			JOptionPane.showMessageDialog(null,"创建用户文档失败");
    		}
    	}
    	usersListRead();
    	user=new File(file);
    	if(!user.exists()){
    		try{
    			user.createNewFile();
    		}catch(Exception e1){
    			JOptionPane.showMessageDialog(null,"创建用户文档失败");
    		}
    	}
    	//Login
    	LoginGui loginGui=new LoginGui();
    }
    public static void usersListRead(){
    	try{
    		fw=new FileReader("stu.txt");//字符流
    	}catch(Exception e){
    		System.out.println("字符流创建失败");
    	}
    	BufferedReader bfr=new BufferedReader(fw);
    	String temp;
    	try{
    		//System.out.println("开始写入list");
    		while((temp=bfr.readLine())!=null){
    			String[] tmpstr=temp.split("\\s+");//分割空格
    			Account a=new Account(tmpstr[0],tmpstr[1]);
    			usersList.add(a);
    		}
    		bfr.close();
    		fw.close();
    	}catch(Exception e){
    		System.out.println("读取用户文档失败");
    	}
    }
    

    }

    展开全文
  • 学生学籍管理

    2014-07-06 10:58:31
    用c语言实现的学生学籍管理系统,完美实现课程设计的基本功能!
  • 学生学籍管理信息系统使用的ASP.NET2.0与数据库2005实现学籍管理信息系统。功能齐全 包括选课 教师管理 添加教师 添加学生 代码能运行
  • 学生学籍管理系统asp

    2009-12-23 18:22:27
    学生学籍管理学生学籍管理学生学籍管理学生学籍管理学生学籍管理学生学籍管理学生学籍管理学生学籍管理学生学籍管理学生学籍管理学生学籍管理学生学籍管理学生学籍管理
  • 学生学籍管理、

    2014-05-20 13:36:09
    学生学籍管理系统用的jAVA与sql2005完成的 ,关于学生学籍系统的应用
  • .net学生学籍管理系统

    2017-08-04 09:41:42
    .net学生学籍管理系统
  • 学生学籍管理系统 学生的相关功能

     SCx.java

    package studentManage;
    
    import javax.swing.*;
    
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    
    public class SCx extends JFrame implements ActionListener {
    	static SCx s;
    	static JLabel label1 = new JLabel("学号:");
    	static JTextField textField1 = new JTextField("");
    	static JLabel label2 = new JLabel("姓名:");
    	static JTextField textField2 = new JTextField("");
    	static JLabel label3 = new JLabel("班级:");
    	static JTextField textField3= new JTextField("");
    	static JLabel label4 = new JLabel("专业:");
    	static JTextField textField4 = new JTextField("");
    	static JLabel label5 = new JLabel("院系:");
    	static JTextField textField5 = new JTextField("");
    	static JLabel label6 = new JLabel("性别");
    	static JTextField textField6 = new JTextField("");
    	static JLabel label7 = new JLabel("年级:");
    	static JTextField textField7 = new JTextField("");
    	static JLabel label8 = new JLabel("生日");
    	static JTextField textField8 = new JTextField("");
    	static JLabel label9 = new JLabel("电话:");
    	static JTextField textField9 = new JTextField("");
    	static JLabel label10 = new JLabel("QQ:");
    	static JTextField textField10 = new JTextField("");
    	static JLabel label11 = new JLabel("状态:");
    	static JTextField textField11 = new JTextField("");
    	static JLabel label12 = new JLabel("密码:");
    	static JTextField textField12 = new JTextField("");
    	
    	static JButton button3 = new JButton("查询");
    	static JButton button4 = new JButton("修改");
    
    	//初始化界面	
    	public SCx() throws Exception {
    		this.setTitle("查询学生信息");
    		this.setLayout(null);
    		
    		this.setSize(600, 600);
    		
    		label1.setBounds(30, 11, 50, 30);	//学号	
    		textField1.setBounds(60, 16, 70, 20);
    		
    		label2.setBounds(160, 11, 50, 30);//姓名
    		textField2.setBounds(190, 16, 70, 20);
    		
    		label3.setBounds(290, 11, 50, 30);//班级
    		textField3.setBounds(320, 16, 70, 20);
    		//===========
    		
    		label4.setBounds(30, 61, 50, 30);//专业
    		textField4.setBounds(60, 66, 70, 20);
    		
    		label5.setBounds(160, 61, 50, 30);//系别
    		textField5.setBounds(190, 66, 70, 20);
    		
    		label6.setBounds(290, 61,50, 30);//性别		
    		textField6.setBounds(320, 66, 70, 20);
    		
    		//===========
    		
    		label7.setBounds(30, 111, 50, 30);//年级	
    		textField7.setBounds(60, 116, 70, 20);	
    		
    		label8.setBounds(140, 111, 50, 30);//出生日期		
    		textField8.setBounds(190, 116, 70, 20);
    		
    		label9.setBounds(290, 111, 50, 30);//电话
    		textField9.setBounds(320, 116, 70, 20);
    		
    		//=========
    		
    		label10.setBounds(30, 161, 50, 30);//QQ
    		textField10.setBounds(60,166,70,20 );
    		
    		label11.setBounds(160, 161, 50, 30);//状态
    		textField11.setBounds(190,166, 70, 20);
    		
    		label12.setBounds(290, 161, 51, 33);//密码
    		textField12.setBounds(320,166, 70, 22);
    		
    		
    		button3.setBounds(150, 241, 80, 33);
    		button4.setBounds(250, 241, 80, 33);
    		
    		button3.addActionListener(this);
    		button4.addActionListener(this);
    		this.add(label1);
    		this.add(label2);
    		this.add(label3);
    		this.add(label4);
    		this.add(label5);
    		this.add(label6);
    		this.add(label7);
    		this.add(label8);
    		this.add(label9);
    		this.add(label10);
    		this.add(label11);
    		this.add(label12);
    		
    		this.add(textField1);
    		this.add(textField2);
    		this.add(textField3);
    		this.add(textField4);		
    		this.add(textField5);
    		this.add(textField6);
    		this.add(textField7);
    		this.add(textField8);
    		this.add(textField9);
    		this.add(textField10);
    		this.add(textField11);
    		this.add(textField12);		
    		
    		this.add(button3);
    		this.add(button4);
    		this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    		this.setVisible(true);
    
    	}
    
    	
    	
    	public static void main(String[] args) throws Exception {
    		SCx a = new SCx();
    		a.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    		
    	}	
    
    	public void actionPerformed(ActionEvent e) {
    		
    		if (e.getSource() == button3) {
    			try {
    
    				Class.forName("com.mysql.jdbc.Driver");
    			} catch (ClassNotFoundException ce) {
    				JOptionPane.showMessageDialog(s, ce.getMessage());
    			}
    			try {
    				Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/stu","root","111");
    				Statement stmt = con.createStatement();
    				
    				ResultSet rs = stmt.executeQuery("select * from infor where stuId='"
    								+ textField1.getText() + "'");
    				if (textField1.getText().trim().equals("")) {
    					JOptionPane.showMessageDialog(this, "学号不可为空!");
    				}
    				else if (rs.next()) {
    					textField1.setText(rs.getString("stuId"));
    					textField2.setText(rs.getString("name"));
    					textField3.setText(rs.getString("class"));
    					textField4.setText(rs.getString("profess"));
    					textField5.setText(rs.getString("depart"));
    					textField6.setText(rs.getString("sex"));
    					textField7.setText(rs.getString("grade"));
    					textField8.setText(rs.getString("bir"));
    					textField9.setText(rs.getString("phone"));
    					textField10.setText(rs.getString("QQ"));
    					textField11.setText(rs.getString("state"));
    					textField12.setText(rs.getString("password"));
    				
    				} else {
    					JOptionPane.showMessageDialog(this, "无此记录!!!");
    				}
    			}
    			catch (SQLException se) {
    				JOptionPane.showMessageDialog(s, se.getMessage());
    			}
    		}
    		
    		if(e.getSource()==button4)
    	    {
    				try{
    		
    						Class.forName("com.mysql.jdbc.Driver");
    						}
    				catch (ClassNotFoundException ce)
    					{
    						JOptionPane.showMessageDialog(s,ce.getMessage());
    					}
    				try
    				{
    					Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/stu","root","111");
    				
    					Statement stmt = con.createStatement();
    				
    				
    	     ResultSet rs=stmt.executeQuery("select * from infor where stuId='"+textField1.getText()+"'");
    	                if(textField1.getText().trim().equals(""))
    	                {
    	                    JOptionPane.showMessageDialog(this,"学号不可为空!");
    	                }else if(rs.next())
    	               {             
    	                	 try{
    	                	stmt.execute("update infor set name='"+
    	               	          textField2.getText()+"',class='"+textField3.getText()+"',profess='"+
    	               	                 textField4.getText()+"',depart='"+textField5.getText()+"',sex='"+
    	               	                 textField6.getText()+"',grade='"+textField7.getText()+"',bir='"+
    	               	                 textField8.getText()+ "',phone='"+textField9.getText()+"',QQ='"+textField10.getText()+
    	               	                 "',state='"+textField11.getText()+"',password='"+textField12.getText()
    	               	              +"'where stuId='"+textField1.getText
    
    	               	           ()+"'"
    );                	
    	                				JOptionPane.showMessageDialog(null,"修改成功");                 	 
    	                	 }               	                
    	               	                 	//stmt.executeQuery(updateSql);}
    	               	             // stmt.executeUpdate(updateSql);}
    	               	                 	catch(SQLException se)
    	               	                 	{
    	               	                 	//JOptionPane.showMessageDialog(null,"请输入正确的信息");
    	               	                 	JOptionPane.showMessageDialog(s,se.getMessage());               	                 		
    	               	                 	}      	                 
    	                	               	
    	               	}   	
    	                     }
    	      	catch(SQLException se)
    	        {
    	           JOptionPane.showMessageDialog(s,se.getMessage());
    	          }
    	    }
    		
    		
    		
    	}
    }
    

    SInterface.java

    package studentManage;
    
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    
    /*
     * 学生登录
     * 操作界面接口类,可以直接扩展、调用。
     */
    
    public class SInterface extends JFrame implements ActionListener {
    	static JMenuBar jMenuBar = new JMenuBar();// 菜单条
    	static JMenu jMenuFile = new JMenu("文件");// 菜单项
    	static JMenu jMenuExit = new JMenu("退出");
    	//static JMenuItem jMenuItem1 = new JMenuItem("添加信息");// 菜单子项
    	static JMenuItem jMenuItem2 = new JMenuItem("修改信息");
    	static JMenuItem jMenuItem3 = new JMenuItem("信息查询");
    	//static JMenuItem jMenuItem4 = new JMenuItem("删除信息");
    	static JLabel label3 = new JLabel("请选择操作项");
    	static JLabel label4 = new JLabel("学籍管理系统");
    	//static JButton button2 = new JButton("添加信息");
    	static JButton button3 = new JButton("修改信息");
    	static JButton button4 = new JButton("信息查询");
    	//static JButton button5 = new JButton("删除信息");
    
    	public SInterface() {
    		this.setTitle("学籍管理系统");
    		this.setLayout(null);
    		this.setSize(400, 400);
    		label3.setBounds(158, 92, 98, 33);
    		label3.setFont(new Font("Dialog", Font.PLAIN, 15));
    		label4.setFont(new Font("Dialog", Font.BOLD, 20));
    		label4.setBounds(157, 37, 280, 40);
    		//button2.setBounds(74, 136, 97, 33);
    		button3.setBounds(226, 136, 97, 33);//修改信息
    		button4.setBounds(74, 136, 97, 33);//信息查询
    		//button5.setBounds(226, 185, 97, 33);
    		//this.add(button2);
    		this.add(button3);
    		this.add(button4);
    		//this.add(button5);
    		this.add(label3);
    		this.add(label4);
    		setJMenuBar(jMenuBar);
    		//jMenuFile.add(jMenuItem1);// ”文件“菜单项中加入子菜单
    		jMenuFile.add(jMenuItem2);
    		jMenuFile.add(jMenuItem3);
    		//jMenuFile.add(jMenuItem4);
    		jMenuBar.add(jMenuFile);// 将菜单项加入菜单条
    		jMenuBar.add(jMenuExit);
    		//button2.addActionListener(this);// 本窗口向按钮事件源注册
    		button3.addActionListener(this);
    		button4.addActionListener(this);
    		//button5.addActionListener(this);
    		//jMenuItem1.addActionListener(this);// 本窗口菜单子项注册
    		jMenuItem2.addActionListener(this);
    		jMenuItem3.addActionListener(this);
    		//jMenuItem4.addActionListener(this);
    		jMenuExit.addActionListener(this);
    		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    		this.setVisible(true);
    	}
    
    	public static void main(String[] args) {
    		SInterface a = new SInterface();
    	}
    
    	public void actionPerformed(ActionEvent e) // 按钮事件的处理
    	{
    		if (e.getSource() == jMenuExit) {
    			System.exit(0);
    		}   if (e.getSource() == jMenuItem3 || e.getSource() == button4) {
    			try {
    				SCx a = new SCx();
    			} catch (Exception ec) {
    			}
    		} 
    	}
    }
    

    SXg.java

    package studentManage;
    
    import javax.swing.*;
    
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    
    public class SXg extends JFrame implements ActionListener {
    	static SXg s;
    	static JLabel label1 = new JLabel("学号:");
    	static JTextField textField1 = new JTextField("");
    	static JLabel label2 = new JLabel("姓名:");
    	static JTextField textField2 = new JTextField("");
    	static JLabel label3 = new JLabel("性别:");
    	static JTextField textField7 = new JTextField("");
    	static JLabel label4 = new JLabel("出生日期:");
    	static JTextField textField3 = new JTextField("");
    	static JLabel label5 = new JLabel("政治面貌:");
    	static JTextField textField8 = new JTextField("");
    	static JLabel label6 = new JLabel("籍贯");
    	static JTextField textField4 = new JTextField("");
    	static JLabel label7 = new JLabel("系别:");
    	static JTextField textField9 = new JTextField("");
    	static JLabel label8 = new JLabel("专业:");	
    	static JTextField textField5 = new JTextField("");
    	static JButton button2 = new JButton("修改");
    
    	public SXg() {
    		this.setTitle("修改学生信息");
    		this.setLayout(null);
    		this.setSize(400, 400);
    		label1.setBounds(30, 11, 51, 33);
    		textField1.setBounds(86, 16, 74, 22);
    		label2.setBounds(162, 11, 51, 33);
    		textField2.setBounds(192, 16, 44, 22);
    		label3.setBounds(241, 11, 70, 33);
    		textField7.setBounds(275, 15, 50, 25);
    		label4.setBounds(31, 53, 55, 33);
    		textField3.setBounds(86, 58, 74, 22);
    		label5.setBounds(241, 53, 70, 33);
    		textField8.setBounds(296, 57, 72, 25);
    		label6.setBounds(163, 53, 26, 33);
    		textField4.setBounds(191, 58, 44, 22);
    		label7.setBounds(30, 94, 50, 33);
    		textField9.setBounds(86, 94, 74, 22);
    		label8.setBounds(163, 94, 51, 33);
    		textField5.setBounds(190, 99, 178, 22);
    		button2.setBounds(115, 241, 80, 33);
    		button2.addActionListener(this);
    		this.add(label1);
    		this.add(label2);
    		this.add(label3);
    		this.add(label4);
    		this.add(label5);
    		this.add(label6);
    		this.add(label7);
    		this.add(label8);
    		this.add(textField1);
    		this.add(textField2);
    		this.add(textField3);
    		this.add(textField4);
    		this.add(textField5);
    		this.add(textField7);
    		this.add(textField8);
    		this.add(textField9);
    		this.add(button2);
    		this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    		this.setVisible(true);
    	}
    
    	public static void main(String[] args) throws Exception {
    		SXg a = new SXg();
    		a.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    	}
    
    	public void actionPerformed(ActionEvent e)//事件处理程序
       {
        if(e.getSource()==button2)
        {
    			try{
    	
    					Class.forName("com.mysql.jdbc.Driver");
    					}
    			catch (ClassNotFoundException ce)
    				{
    					JOptionPane.showMessageDialog(s,ce.getMessage());
    				}
    			try
    			{
    				Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/stu","root","111");
    			
    				Statement stmt = con.createStatement();
    			
    			
         ResultSet rs=stmt.executeQuery("select * from infor where stuId='"+textField1.getText()+"'");
                    if(textField1.getText().trim().equals(""))
                    {
                        JOptionPane.showMessageDialog(this,"学号不可为空!");
                    }else if(rs.next())
                   {             
                    	 try{
                    	stmt.execute("update infor set stuId='"+textField1.getText()+"',name='"+
                   	          textField2.getText()+"',sex='"+textField7.getText()+"',birDate='"+
                   	                 textField3.getText()+"',look='"+textField8.getText()+"',jiGuan='"+
                   	                 textField4.getText()+"',xiBie='"+textField9.getText()+"',zhuanYe='"+
                   	                 textField5.getText()+ "'");                	
                    				JOptionPane.showMessageDialog(null,"修改成功");                 	 
                    	 }               	                
                   	                 	//stmt.executeQuery(updateSql);}
                   	             // stmt.executeUpdate(updateSql);}
                   	                 	catch(SQLException se)
                   	                 	{
                   	                 	//JOptionPane.showMessageDialog(null,"请输入正确的信息");
                   	                 	JOptionPane.showMessageDialog(s,se.getMessage());               	                 		
                   	                 	}      	                 
                    	               	
                   	}   	
                         }
          	catch(SQLException se)
            {
               JOptionPane.showMessageDialog(s,se.getMessage());
              }
        }
        
        
        
      }
    }
    




    展开全文
  • 学生学籍管理系统.zip

    2019-12-28 23:34:40
    1、学生学籍管理系统:调查学校学生处、教务处,设计一个学籍管理系统。 要求:学生学籍管理系统分为学生信息管理、学生成绩管理、考试管理和用户管理四个功能模块。 (1)学生信息管理模块主要是对学生信息(如...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 8,305
精华内容 3,322
关键字:

学生学籍查询平台