易截截图软件、单文件、免安装、纯绿色、仅160KB

java io正确读取

写入
 public static void Writer(String value) {
         try{
          File file2 = new File("F:\\countDB.txt");
          if(!file2.exists()){
            file2.createNewFile();
          }
          FileOutputStream writer = new FileOutputStream(file2,true);
          OutputStreamWriter rp = new OutputStreamWriter(writer,"GBK");
          BufferedWriter tmpBR = new BufferedWriter(rp,1024*1024);
          tmpBR.write(value+"\r\n");
          tmpBR.flush();
          tmpBR.close();
          rp.flush();
          rp.close();
          writer.flush();
          writer.close();
         }catch(Exception ex){
          //ex.fillInStackTrace();
         }
         
     }
查询
File file = new File("E:\\DB.txt");
       FileInputStream read = new FileInputStream(file);
       InputStreamReader rp = new InputStreamReader(read,"GBK");
       BufferedReader tmpBR = new BufferedReader(rp,1024*1024);
       String tmpLine = tmpBR.readLine();
      
       while (tmpLine != null) {
    &n


相关文档:

java 调用命令 备份mysql数据库

 代码如下:
  1  String command  =   " cmd /c C:/Program Files/MySQL/MySQL Server 5.0/bin>mysqldump -h localhost -u root -p aijia > E:/aijia.dmp " ;
  2      try    {
  3     Process process& ......

java profiler

Dear han luoxing,
Thank you for trying YourKit Java Profiler.
Please find your personal evaluation license key below.
With this key, you can evaluate YourKit Java Profiler for 15 days, starting today.
When asked to provide license key, copy and paste the following entire block of lines:
13c970a ......

java解析properties的方法

1。使用java.util.Properties类的load()方法
示例: InputStream in = lnew BufferedInputStream(new FileInputStream(name));
Properties p = new Properties();
p.load(in);
2。使用java.util.ResourceBundle类的getBundle()方法
示例: ResourceBundle rb = ResourceBundle.getBundle(name, Locale.getDefault()); ......

java实现输出字符串中的数字字符

package com.joe;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Test
{
    //将字符串的数字字符输出
    public static void main(String[] args)
    {
        String str = "iu7i8hy4j ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号