- 浏览: 23945 次
- 性别:
- 来自: 北京
文章列表
public static ArrayList read_xlsx(String path_sour, String path_end) {
ArrayList al = new ArrayList();
//String strPath = "c://22.xlsx";
XSSFWorkbook xwb = null;
try {
xwb = new XSSFWorkbook(path_sour);
// 读取第一章表格内容
XSSFSheet sheet = xwb.getSheetAt(0);
// 定义 ro ...
public static ArrayList read_xls(String path_sour,String path_end) {
jxl.Workbook rwb = null;
ArrayList al = new ArrayList();
try {
// 构建Workbook对象, 只读Workbook对象
// 直接从本地文件创建Workbook
// 从输入流创建Workbook
InputStream is = new FileInputStream(path_sour);
rwb = Workbook.getWo ...
public static String toCH(int num) {
String[] chNum = { "〇", "一", "二", "三", "四", "五", "六", "七", "八", "九" };
String chShi = "十";
String chBai = "百";
String chQian = &qu ...
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import ...
public static String to_utf8(String utf8) {
int len = utf8.length();
String[] s = new String[len];
// cn -> unicode
for (int i = 0; i < len; i++) {
char c = utf8.charAt(i);
s[i] = Integer.toString(c, 16);
// System.out.println(c + "\t\\u" + s[i]);
}
// ...
import java.io.IOException;
import java.security.SecureRandom;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
public class DesTmp {
p ...
public static void do_http_post(String post_url) {
try {
URL url = new URL(post_url);
URLConnection con = url.openConnection();
con.setDoOutput(true);
con.setRequestProperty("Pragma:", "no-cache");
con.setRequestProperty("Cache-Control", "no ...
public static void main(String[] args) {
long ltoday = System.currentTimeMillis();
// long lyesday = ltoday-24*60*60*1000l;
long l7day = ltoday - 7 * 24 * 60 * 60 * 1000l;
// 昨天
long lyesday = ltoday-24*60*60*1000l;
java.sql.Timestamp todaytimes = new java.sql.Timestamp(ltoday); ...
public static void filepath(){
String filepath = "c:\\test";
File file = new File(filepath);
if (file.isDirectory()) {
String[] filelist = file.list();
for (int i = 0; i < filelist.length; i++) {
File readfile = new File(filepath + "\\" + filelist[i]);
...
public static void game_ua() {
Connection conn = null;
PreparedStatement stmt_user = null;
ResultSet rs_user = null;
BufferedReader bufferedreader = null;
String stemp;
try {
bufferedreader = new BufferedReader(new FileReader("c:/test.txt"));
conn = mysql();
...
package test.thread;
import java.util.Timer;
import java.util.TimerTask;
public class MainThread {
private Object lock = new Object();
public void waitLock() throws InterruptedException {
synchronized (lock) {
lock.wait();
}
}
public void notifyLock() {
synchronize ...