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

JAVA文件操作

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.channels.FileChannel;
public class DealFile {
     /**
      * 删除文件
      * @param filePathAndName String 文件路径及名称
      * @param fileContent String
      * @return boolean
      */
    public void delFile(String filePathAndName) {
        try {
            String filePath = filePathAndName;
            filePath = filePath.toString();
            java.io.File myDelFile = new java.io.File(filePath);
            myDelFile.delete();
 
        }
        catch (Exception e) {
            System.out.println("删除文件操作出错");
            e.printStackTrace();
 
        }
 
    }
  /**
      * 删除文件夹
      * @param path String 文件夹路径
      */
  public static void delAllFile(String path){
   File file = new File(path);
   File[] filelist = file.listFiles();
   for(int i=0;i<filelist.length;i++){
    if(!filelist[i].isDirectory()){
     filelist[i].delete();
     System.out.println("文件:"+fileli


相关文档:

sql 2005 存储过程分页 java 代码

 create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',         
@pagesize int output,--每页显示记录条数
@currentpage int output,--第几页
@orderid nvarchar(50),--主键排序
@sort int,--排序方式,1表示升序,0表示降序排列 ......

java中对date相关操作

String startTime, String endTime;
Date start = null;
Date end = null;
Date startTimeStamp = null;
Date endTimeStamp = null;

try {

SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd");
......

Linux下Java环境变量的设置

如果想让所有用户share:
emacs -nw /etc/profile
然后在未尾加入
#set java environment
set JAVA_HOME=/usr/java/jdk1.5.0_16
set PATH=.:$JAVA_HOME/bin:$PATH
export PATH JAVA_HOME
如果仅当前用户使用:
把上面的加入用户目录下的.bash_profile或.bash-rc
然后运行source /etc/profile生效 ......

java web开发中防止乱码的方法

1.在系统中导入一下source
SetCharacterEncodingFilter.java
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements.  See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号