📄 calcaction.java
字号:
package com.rtsoft.calc.action;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import com.rtsoft.calc.util.StringUtil;
public class CalcAction {
public static boolean saveMac(String mac, int no) {
try {
String macx = "0x" + mac;
File tofile = new File("Mac.txt");
FileWriter fw = new FileWriter(tofile);
BufferedWriter buffw = new BufferedWriter(fw);
long in = Long.decode(macx).longValue();
int flag = 0;
String str="";
for (int i = 0; i < no; i++) {
if((i-flag*100)==35){
buffw.write("★★★★★★★★★★★★★★★★★★★★");
buffw.newLine();
}
if((i-flag*100)==70){
buffw.write("★★★★★★★★★★★★★★★★★★★★");
buffw.newLine();
}
if (i != 0 && i % 100 == 0) {
buffw.write("■■■■■■■■■■■■■■■■■■■■");
buffw.newLine();
flag++;
}
str = Long.toHexString(in + i).toUpperCase();
while(str.length()<12){
str = "0"+str;
}
buffw.write(str+ " " + (i + 1));
buffw.newLine();
}
buffw.newLine();
buffw.newLine();
buffw.newLine();
buffw.newLine();
buffw.newLine();
buffw.write("共计:" + no + "个");
buffw.close();
} catch (Exception e) {
e.printStackTrace();
}
return true;
}
public static boolean saveId(long Id,long No,String box){
try{
File tofile = new File("Id.txt");
FileWriter fw = new FileWriter(tofile);
BufferedWriter buffw = new BufferedWriter(fw);
int flag = 0;
String boxes = "";
int boxs=0;
String str = "";
int bi = 0;
for(int i=0;i<No;i++){
if((i-flag*100)==35){
buffw.write("★★★★★★★★★★★★★★★★★★★★");
buffw.newLine();
}
if((i-flag*100)==70){
buffw.write("★★★★★★★★★★★★★★★★★★★★");
buffw.newLine();
}
if (i != 0 && i % 100 == 0) {
buffw.write("■■■■■■■■■■■■■■■■■■■■");
buffw.newLine();
flag++;
}
str = Id+"";
while(str.length()<16){
str = "0"+str;
}
if(bi%5==0){
boxs++;
}
buffw.write(str+" " + box+StringUtil.IdNoSum(No, boxs));
buffw.newLine();
Id++;
bi++;
}
buffw.newLine();
buffw.newLine();
buffw.newLine();
buffw.newLine();
buffw.newLine();
buffw.write("共计:" + No + "个");
buffw.close();
}catch(Exception e){
e.printStackTrace();
}
return true;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -