`
文章列表
\b    backspace键 \t     Tab键 \n    按行回车 \r     回车 \”     双引号 \’     单引号 \\     反斜杠
如何将字串 String 转换成整数 int? int i = Integer.valueOf(my_str).intValue(); int i=Integer.parseInt(str); 如何将字串 String 转换成Integer ? Integer integer=Integer.valueOf(str); 如何将整数 int 转换成字串 String ? 1.) String s = String.valueOf(i); 2.) String s = Integer.toString(i); 3.) String s = "" + i; 如何 ...
public String str_replace(String from,String to,String source) {          StringBuffer bf= new StringBuffer("");      StringTokenizer st = new StringTokenizer(source,from,true);      while (st.hasMoreTokens()) {        String tmp = st.nextToken();        if(tmp.equals(from)) {       ...

Timer

import java.util.Timer; public class Test { Timer timer = new Timer(); public int userStateTimerStart(int round_id){ timer.schedule(new aaa(round_id), 000, 500); return round_id; } public void mapTimeStart(int round_id){ timer.schedule(new bbb(round_id), 000, 1000); } pub ...

DBbean

import java.sql.*; public class DBBean { private String driverStr = "com.mysql.jdbc.Driver"; private String connStr = "jdbc:mysql://localhost/context"; private String username = ""; private String password = ""; private Connection conn = null; private St ...
import java.util.Scanner; public class IntegerReverse { //testing method public static void main(String[] args) { Scanner input = new Scanner(System.in);     System.out.println("请输入一个整数:");     int in = input.nextInt();     System.out.print(reverse(in));    } //reverse ...
import java.util.*; import java.io.*; public class StringPractice { public static void main(String[] args) throws IOException { // TODO Auto-generated method stub BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("input sth"); String st=b ...

Check Details

Rsa001 rsa=new Rsa001(); byte[] sign=file2.getFileData(); String s = new String(sign); System.out.println("sign is "+s); String[] signatureInfo = s.split("&", 4); System.out.println("signatureInfo is "+signatureInfo.length); if(signatureInfo.length!=4){ retur ...
Rsa001 rsa=new Rsa001(); KeyPair key=rsa.create(); byte[] pub=key.getPublic().getEncoded(); byte[] pri=key.getPrivate().getEncoded(); byte[] fileSign=rsa.sign("abc".getBytes(),pri); String signFileName="abc"+".isop"; System.out.println("out is &quo ...
import java.io.FileInputStream; import java.io.IOException; import java.security.*; import java.security.cert.CertificateFactory; import java.security.spec.EncodedKeySpec; import java.security.spec.PKCS8EncodedKeySpec; import java.security.spec.X509EncodedKeySpec; public class Rsa001 { public sta ...
import java.io.File; import java.io.FileReader; import java.io.OutputStreamWriter; import java.net.URL; import java.net.URLConnection; import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.XMLReader; import org.xml.sax.helpers.DefaultHandl ...
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.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; public class Port ...
public boolean TomcatServer(String port){ try{ URL url = new URL("http://localhost:"+port+"/TestingIdP/"); URLConnection con = url.openConnection();          java.io.BufferedReader in = new      java.io.BufferedReader(new java.io.InputStreamReader(con.getInputStream())) ...
public static boolean ExecRun(String name){ boolean bl=true;          String s = "cmd.exe /c start /min "+name;           try   {           Runtime.getRuntime().exec(s);           }   catch   (IOException   e)   {             bl=false;                 e.printStackTrace();         ...
import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import org.apache.tools.zip.ZipEntry; import org.apache.tools.zip.ZipFile; public class UnZIPcontrol { /**   * 创建目录   *   * @param path   *            目录绝对路 ...
Global site tag (gtag.js) - Google Analytics