📄 custom.java
字号:
//package library2;import java.io.*;import java.util.*;import javax.swing.*;import java.text.*;public class custom{ public static String custom_name,custom_id; //public static String all_custom= "luocheng 111111;" + "binbin 123456;" + //"dabao 222222;" + "zhaoqiang 333333;" + "junxin 444444"; //public static int custom_number = 5; //public static int []com_number = new int[custom_number]; //public String str //public void custom(String str) //{ // all_custom = str; //} public static void register(String str1, String str2) { try { BufferedReader inFile = new BufferedReader (new FileReader("custom.txt")); FileWriter outData = new FileWriter("副本.txt"); PrintWriter outFile = new PrintWriter(outData); String custom_information = inFile.readLine(); while(custom_information != null) { outFile.println(custom_information); custom_information = inFile.readLine(); } String str = str1 + " " + str2; outFile.println(str); outFile.close(); //inFile.close(); BufferedReader inFile2 = new BufferedReader (new FileReader("副本.txt")); PrintWriter outFile2 = new PrintWriter (new FileWriter("custom.txt")); str = inFile2.readLine(); while(str != null) { outFile2.println(str); str = inFile2.readLine(); } outFile2.close(); PrintWriter newFile = new PrintWriter(new FileWriter(str1 + ".txt")); newFile.close(); FileWriter outData3 = new FileWriter(str1 + ".txt"); PrintWriter outFile3 = new PrintWriter(outData3); outFile3.println("0"); outFile3.close(); } catch (FileNotFoundException e) { System.exit(0); } catch(IOException e) { System.exit(0); } } public static boolean y_n_custom(String str1, String str2) { try { String str = str1 + " " + str2; BufferedReader inFile = new BufferedReader (new FileReader("custom.txt")); String custom_information = inFile.readLine(); while(custom_information != null) { if(str.equals(custom_information)) { break; } custom_information = inFile.readLine(); } if(custom_information != null) { return true; } else { return false; } } catch (FileNotFoundException e) { System.exit(0); return false; } catch(IOException e) { System.exit(0); return false; } } public static void main(String[] args) { custom custom_object = new custom(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -