configoperationstring.java
来自「桌面管理 可以将桌面的快捷方式集中管理」· Java 代码 · 共 72 行
JAVA
72 行
package com.deskManager.File;import com.deskApp.Interface.FileOperation;import java.io.*;import java.util.ArrayList;public class ConfigOperationString implements FileOperation { public static String ConfigFileName = "data/proData/config.config"; public Config getConfig() throws Exception { FileReader fr = new FileReader(ConfigFileName); BufferedReader br = new BufferedReader(fr); String temp = br.readLine(); br.close(); fr.close(); char t[] = new char[1]; int count = 0; String tempstr[] = new String[2]; String tt = ""; for (int i = 0; i < temp.length(); i++) { t[0] = temp.charAt(i); if (t[0] == '|') { tempstr[count] = tt; count++; tt = ""; } else { tt = tt + new String(t); } } Config config = new Config(); config.setDoublechick(Integer.parseInt(tempstr[0])); config.setHistory(tempstr[1]); return config; } @Override public void SaveOrUpdate(Object config) throws Exception { FileWriter fw = new FileWriter(ConfigFileName); BufferedWriter bw = new BufferedWriter(fw); bw.write(config.toString()); bw.close(); fw.close(); } public int getDoubleChick() throws Exception { Config config = getConfig(); return config.getDoublechick(); } public String getHistory() throws Exception { Config config = getConfig(); return config.getHistory(); } @SuppressWarnings("unchecked") @Override public ArrayList list() throws Exception { throw new UnsupportedOperationException("Not supported yet."); } @Override public void del(Object o) throws Exception { throw new UnsupportedOperationException("Not supported yet."); } protected void taxis() throws Exception { throw new UnsupportedOperationException("Not supported yet."); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?