⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 console.java

📁 企业内部管理系统
💻 JAVA
字号:
package control;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;

public class Console {
	public String S1;

	public String S2;

	public String S3;

	public String S4;

	public String S5;

	public Console() {

	}

	public Console(String s5) {
		S5 = s5;
	}

	public Console(String s1, String s2, String s3, String s4) {
		S1 = s1;
		S2 = s2;
		S3 = s3;
		S4 = s4;
	}

	public void csvSave() {
		// String[] argsArr = null;
		StringBuffer temp = new StringBuffer();
		try {
			File f = new File("CSV.csv");
			if (!f.exists())
				f.createNewFile();
			String rec = null;
			rec = S1 + "," + S2 + "," + S3 + "," + S4 + "," + "\n";
			temp.append(rec);
			BufferedWriter bw = new BufferedWriter(new FileWriter(f, true));
			bw.write(temp.toString());
			bw.close();
			// br.close();

		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public String csvLoad() {
		BufferedReader in;
		try {
			in = new BufferedReader(new FileReader("CSV.csv"));

			String sq, s2 = new String();
			while ((sq = in.readLine()) != null)
				s2 += sq + "\n";
			in.close();
			return s2;
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}
	public String outsiadeNoiceLoad() {
		BufferedReader in;
		try {
			in = new BufferedReader(new FileReader("txt\\对外公告\\outside.txt"));

			String sq, s2 = new String();
			while ((sq = in.readLine()) != null)
				s2 += sq + "\n";
			in.close();
			return s2;
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}
	public String[] MemberLoad() {
		BufferedReader ine;
		try {
			ine = new BufferedReader(new FileReader("Member.csv"));

			String[] temp1 = new String[7];
			String stemp = null;
			stemp = ine.readLine();
			while (stemp != null) {
				temp1 = stemp.split(",", 7);
				if (temp1[0].equals(S5))
					return temp1;
				stemp = ine.readLine();
			}
			ine.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}
	public String TempLoginInfoLoad() {
		BufferedReader inn;
		try {
			inn = new BufferedReader(new FileReader("TempLoginInfo.csv"));
			String[] temp = new String[3];
			String str1, sq = new String();
			sq = inn.readLine();
			temp = sq.split(",", 3);
			str1 = temp[2];
			inn.close();
			return str1;
		} catch (IOException eop) {
			eop.printStackTrace();
		}
		return null;
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Console grp = new Console("111", "111", "111", "111");
		grp.csvLoad();
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -