`
chenhsong
  • 浏览: 44804 次
  • 性别: Icon_minigender_1
  • 来自: 洛阳
社区版块
存档分类
最新评论

Java文件操作大全

阅读更多

1.创建文件夹 

File myFolderPath = new File(%%1);  
try {  
if (!myFolderPath.exists()) {  
     myFolderPath.mkdir();  
}  
}  
catch (Exception e) {  
System.out.println("新建目录操作出错");  
e.printStackTrace();  
}   

 

2.创建文件 

File myFilePath = new File(%%1);  
try {  
if (!myFilePath.exists()) {  
myFilePath.createNewFile();  
}  
FileWriter resultFile = new FileWriter(myFilePath);  
PrintWriter myFile = new PrintWriter(resultFile);  
myFile.println(%%2);  
resultFile.close();  
}  
catch (Exception e) {  
System.out.println("新建文件操作出错");  
e.printStackTrace();  
}   

 

 

3.删除文件 

File myDelFile = new File(%%1);  
try {  
myDelFile.delete();  
}  
catch (Exception e) {  
System.out.println("删除文件操作出错");  
e.printStackTrace();  
}   

 

 

4.删除文件夹

File delFolderPath = new File(%%1);  
try {  
delFolderPath.delete(); //删除空文件夹  
}  
catch (Exception e) {  
System.out.println("删除文件夹操作出错");  
e.printStackTrace();  
}   

 

 

5.删除一个文件下夹所有的文件夹  

File delfile=new File(%%1);  
File[] files=delfile.listFiles();  
for(int i=0;i<files.length;i++){  
if(files.isDirectory()){  
files.delete();  
    }  
}   

 

6.清空文件夹

File delfilefolder=new File(%%1);  
try {  
if (!delfilefolder.exists()) {  
delfilefolder.delete();  
}  
delfilefolder.mkdir();  
}  
catch (Exception e) {  
System.out.println("清空目录操作出错");  
e.printStackTrace();  
}   

 

 

7.读取文件

// 逐行读取数据  
FileReader fr = new FileReader(%%1);  
BufferedReader br = new BufferedReader(fr);  
String %%2 = br.readLine();  
while (%%2 != null) {  
%%3  
%%2 = br.readLine();  
}  
br.close();  
fr.close();   

 

 

8.写入文件

// 将数据写入文件  
FileWriter fw = new FileWriter(%%1);  
fw.write(%%2);  
fw.close();

 

 

9.写入随机文件

try {  
RandomAcessFile logFile=new RandomAcessFile(%%1,"rw");  
long lg=logFile.length();  
logFile.seek(%%2);  
logFile.writeByte(%%3);  
}catch(IOException ioe){  
System.out.println("无法写入文件:"+ioe.getMessage());  
}   

 

 

10.读取文件属性

// 文件属性的取得  
File af = new File(%%1);  
if (af.exists()) {  
System.out.println(f.getName() + "的属性如下: 文件长度为:" + f.length());  
System.out.println(f.isFile() ? "是文件" : "不是文件");  
System.out.println(f.isDirectory() ? "是目录" : "不是目录");  
System.out.println(f.canRead() ? "可读取" : "不");  
System.out.println(f.canWrite() ? "是隐藏文件" : "");  
System.out.println("文件夹的最后修改日期为:" + new Date(f.lastModified()));  
} else {  
System.out.println(f.getName() + "的属性如下:");  
System.out.println(f.isFile() ? "是文件" : "不是文件");  
System.out.println(f.isDirectory() ? "是目录" : "不是目录");  
System.out.println(f.canRead() ? "可读取" : "不");  
System.out.println(f.canWrite() ? "是隐藏文件" : "");  
System.out.println("文件的最后修改日期为:" + new Date(f.lastModified()));  
}  
if(f.canRead()){  
%%2  
}  
if(f.canWrite()){  
%%3  
}   

 

 

11.写入属性

File filereadonly=new File(%%1);  
try {  
boolean b=filereadonly.setReadOnly();  
}  
catch (Exception e) {  
System.out.println("拒绝写访问:"+e.printStackTrace());  
}   

 

 

12.枚举一个文件夹中的所有文件夹

//import java.io.*;  
//import java.util.*;  
ArrayList<String> folderList = new ArrayList<String>();  
folderList.add(%%1);  
for (int j = 0; j < folderList.size(); j++) {  
File file = new File(folderList.get(j));  
File[] files = file.listFiles();  
ArrayList<File> fileList = new ArrayList<File>();  
for (int i = 0; i < files.length; i++) {  
if (files.isDirectory()) {  
folderList.add(files.getPath());  
} else {  
fileList.add(files);  
}  
}  
for (File f : fileList) {  
%%2=f.toString();  
%%3  
}  
}   

 

13.复制文件夹

//import java.io.*;  
//import java.util.*;  
ArrayList<String>folderList=new ArrayList<String>();  
folderList.add(%%1);  
ArrayList<String>folderList2=new ArrayList<String>();  
folderList2.add(%%2);  
for(int j=0;j<folderList.length;j++){  
    (new File(folderList2[j])).mkdirs(); //如果文件夹不存在 则建立新文件夹  
    File folders=new File(folderList[j]);  
    String[] file=folders.list();  
    File temp=null;  
    try {  
      for (int i = 0; i < file.length; i++) {  
        if(folderList[j].endsWith(File.separator)){  
          temp=new File(folderList[j]+"/"+file);  
        }  
        else{  
          temp=new File(folderList[j]+"/"+File.separator+file);  
        }  
          FileInputStream input = new FileInputStream(temp);  
        if(temp.isFile()){  
          FileInputStream input = new FileInputStream(temp);  
          FileOutputStream output = new FileOutputStream(folderList2[j] + "/" +  
              (temp.getName()).toString());  
          byte[] b = new byte[5120];  
          int len;  
          while ( (len = input.read(b)) != -1) {  
            output.write(b, 0, len);  
          }  
          output.flush();  
          output.close();  
          input.close();  
        }  
        if(temp.isDirectory()){//如果是子文件夹  
          folderList.add(folderList[j]+"/"+file);  
          folderList2.add(folderList2[j]+"/"+file);  
        }  
      }  
    }  
    catch (Exception e) {  
      System.out.println("复制整个文件夹内容操作出错");  
      e.printStackTrace();  
    }  
}   

 

14.复制一个文件夹下所有的文件夹到另一个文件夹下

File copyfolders=new File(%%1);  
File[] copyfoldersList=copyfolders.listFiles();  
for(int k=0;k<copyfoldersList.length;k++){  
if(copyfoldersList[k].isDirectory()){  
ArrayList<String>folderList=new ArrayList<String>();  
folderList.add(copyfoldersList[k].getPath());  
ArrayList<String>folderList2=new ArrayList<String>();  
folderList2.add(%%2+"/"+copyfoldersList[k].getName());  
for(int j=0;j<folderList.length;j++){  
    (new File(folderList2[j])).mkdirs(); //如果文件夹不存在 则建立新文件夹  
    File folders=new File(folderList[j]);  
    String[] file=folders.list();  
    File temp=null;  
    try {  
      for (int i = 0; i < file.length; i++) {  
        if(folderList[j].endsWith(File.separator)){  
          temp=new File(folderList[j]+"/"+file);  
        }  
        else{  
          temp=new File(folderList[j]+"/"+File.separator+file);  
        }  
          FileInputStream input = new FileInputStream(temp);  
        if(temp.isFile()){  
          FileInputStream input = new FileInputStream(temp);  
          FileOutputStream output = new FileOutputStream(folderList2[j] + "/" +  
              (temp.getName()).toString());  
          byte[] b = new byte[5120];  
          int len;  
          while ( (len = input.read(b)) != -1) {  
            output.write(b, 0, len);  
          }  
          output.flush();  
          output.close();  
          input.close();  
        }  
        if(temp.isDirectory()){//如果是子文件夹  
          folderList.add(folderList[j]+"/"+file);  
          folderList2.add(folderList2[j]+"/"+file);  
        }  
      }  
    }  
    catch (Exception e) {  
      System.out.println("复制整个文件夹内容操作出错");  
      e.printStackTrace();  
    }  
}  
}  
}   

 

15.移动文件夹

ArrayList<String>folderList=new ArrayList<String>();  
folderList.add(%%1);  
ArrayList<String>folderList2=new ArrayList<String>();  
folderList2.add(%%2);  
for(int j=0;j<folderList.length;j++){  
    (new File(folderList2[j])).mkdirs(); //如果文件夹不存在 则建立新文件夹  
    File folders=new File(folderList[j]);  
    String[] file=folders.list();  
    File temp=null;  
    try {  
      for (int i = 0; i < file.length; i++) {  
        if(folderList[j].endsWith(File.separator)){  
          temp=new File(folderList[j]+"/"+file);  
        }  
        else{  
          temp=new File(folderList[j]+"/"+File.separator+file);  
        }  
          FileInputStream input = new FileInputStream(temp);  
        if(temp.isFile()){  
          FileInputStream input = new FileInputStream(temp);  
          FileOutputStream output = new FileOutputStream(folderList2[j] + "/" +  
              (temp.getName()).toString());  
          byte[] b = new byte[5120];  
          int len;  
          while ( (len = input.read(b)) != -1) {  
            output.write(b, 0, len);  
          }  
          output.flush();  
          output.close();  
          input.close();  
        }  
        if(temp.isDirectory()){//如果是子文件夹  
          folderList.add(folderList[j]+"/"+file);  
          folderList2.add(folderList2[j]+"/"+file);  
        }  
      }  
    }  
    catch (Exception e) {  
      System.out.println("复制整个文件夹内容操作出错");  
      e.printStackTrace();  
    }  
}  
File movefile=new File(%%1);  
File[] movefiles=movefile.listFiles();  
for(int i=0;i<files.length;i++){  
if(files.isDirectory()){  
files.delete();  
    }  
}  
movefile.delete();  
  

 

16.移动一个文件夹下所有的文件夹到另一个目录下

File movefolders=new File(%%1);  
File[] movefoldersList=movefolders.listFiles();  
for(int k=0;k<movefoldersList.length;k++){  
if(movefoldersList[k].isDirectory()){  
ArrayList<String>folderList=new ArrayList<String>();  
folderList.add(movefoldersList[k].getPath());  
ArrayList<String>folderList2=new ArrayList<String>();  
folderList2.add(%%2+"/"+movefoldersList[k].getName());  
for(int j=0;j<folderList.length;j++){  
    (new File(folderList2[j])).mkdirs(); //如果文件夹不存在 则建立新文件夹  
    File folders=new File(folderList[j]);  
    String[] file=folders.list();  
    File temp=null;  
    try {  
      for (int i = 0; i < file.length; i++) {  
        if(folderList[j].endsWith(File.separator)){  
          temp=new File(folderList[j]+"/"+file);  
        }  
        else{  
          temp=new File(folderList[j]+"/"+File.separator+file);  
        }  
          FileInputStream input = new FileInputStream(temp);  
        if(temp.isFile()){  
          FileInputStream input = new FileInputStream(temp);  
          FileOutputStream output = new FileOutputStream(folderList2[j] + "/" +  
              (temp.getName()).toString());  
          byte[] b = new byte[5120];  
          int len;  
          while ( (len = input.read(b)) != -1) {  
            output.write(b, 0, len);  
          }  
          output.flush();  
          output.close();  
          input.close();  
temp.delete();  
        }  
        if(temp.isDirectory()){//如果是子文件夹  
          folderList.add(folderList[j]+"/"+file);  
          folderList2.add(folderList2[j]+"/"+file);  
        }  
      }  
    }  
    catch (Exception e) {  
      System.out.println("复制整个文件夹内容操作出错");  
      e.printStackTrace();  
    }  
}  
movefoldersList[k].delete();  
}  
}  

 

17.以一个文件夹的框架在另一个目录创建文件夹和空文件

ArrayList<String>folderList=new ArrayList<String>();  
folderList.add(%%1);  
ArrayList<String>folderList2=new ArrayList<String>();  
folderList2.add(%%2);  
for(int j=0;j<folderList.length;j++){  
    (new File(folderList2[j])).mkdirs(); //如果文件夹不存在 则建立新文件夹  
    File folders=new File(folderList[j]);  
    String[] file=folders.list();  
    File temp=null;  
    try {  
      for (int i = 0; i < file.length; i++) {  
        if(folderList[j].endsWith(File.separator)){  
          temp=new File(folderList[j]+"/"+file);  
        }  
        else{  
          temp=new File(folderList[j]+"/"+File.separator+file);  
        }  
          FileInputStream input = new FileInputStream(temp);  
        if(temp.isFile()){  
if (!temp.exists()) {  
temp.createNewFile();  
}  
        }  
        if(temp.isDirectory()){//如果是子文件夹  
          folderList.add(folderList[j]+"/"+file);  
          folderList2.add(folderList2[j]+"/"+file);  
        }  
      }  
    }  
    catch (Exception e) {  
      System.out.println("复制整个文件夹内容操作出错");  
      e.printStackTrace();  
    }  
}   

 

18.复制文件

      int bytesum = 0;  
      int byteread = 0;  
      File oldfile = new File(%%1);  
    try {  
      if (oldfile.exists()) { //文件存在时  
        InputStream inStream = new FileInputStream(oldfile); //读入原文件  
        FileOutputStream fs = new FileOutputStream(new File(%%2,oldfile.getName()));  
        byte[] buffer = new byte[5120];  
        int length;  
        while ( (byteread = inStream.read(buffer)) != -1) {  
          bytesum += byteread; //字节数 文件大小  
          System.out.println(bytesum);  
          fs.write(buffer, 0, byteread);  
        }  
        inStream.close();  
      }  
    }  
    catch (Exception e) {  
      System.out.println("复制单个文件操作出错");  
      e.printStackTrace();  
    }   

 

19.复制一个文件夹下所有的文件到另一个目录

File copyfiles=new File(%%1);  
File[] files=copyfiles.listFiles();  
for(int i=0;i<files.length;i++){  
if(!files.isDirectory()){  
      int bytesum = 0;  
      int byteread = 0;  
    try {  
        InputStream inStream = new FileInputStream(files); //读入原文件  
        FileOutputStream fs = new FileOutputStream(new File(%%2,files.getName());  
        byte[] buffer = new byte[5120];  
        int length;  
        while ( (byteread = inStream.read(buffer)) != -1) {  
          bytesum += byteread; //字节数 文件大小  
          System.out.println(bytesum);  
          fs.write(buffer, 0, byteread);  
        }  
        inStream.close();  
    } catch (Exception e) {  
      System.out.println("复制单个文件操作出错");  
      e.printStackTrace();  
    }  
}  
}   

 

20.提取扩展名

String %%2=(new File(%%1)).getName().split(".")[1];

 

21.提取文件名

String %%2=(new File(%%1)).getName().split("//")[1];

 22.提取文件路径

String %%2=(new File(%%1)).getPath();

 

23.替换扩展名

File replaceExt=new File(%%1);  
replaceExt.renameTo(replaceExt.getName().split(".")[0]+"."+%%2);

 

24.追加路径

%%3=%%2+"/"+%%1

 

25.移动文件

      int bytesum = 0;  
      int byteread = 0;  
      File oldfile = new File(%%1);  
    try {  
      if (oldfile.exists()) { //文件存在时  
        InputStream inStream = new FileInputStream(oldfile); //读入原文件  
        FileOutputStream fs = new FileOutputStream(new File(%%2,oldfile.getName()));  
        byte[] buffer = new byte[5120];  
        int length;  
        while ( (byteread = inStream.read(buffer)) != -1) {  
          bytesum += byteread; //字节数 文件大小  
          //System.out.println(bytesum);  
          fs.write(buffer, 0, byteread);  
        }  
        inStream.close();  
oldfile.delete();  
      }  
    }  
    catch (Exception e) {  
      System.out.println("复制单个文件操作出错");  
      e.printStackTrace();  
    }   

 

26.移动一个文件夹下所有文件到另一个目录

File movefile=new File(%%1);  
File[] movefiles=movefile.listFiles();  
for(int i=0;i<movefiles.length;i++){  
if(movefiles.isFile()){  
      int bytesum = 0;  
      int byteread = 0;  
      File oldfile = new File(movefiles);  
    try {  
      if (oldfile.exists()) { //文件存在时  
        InputStream inStream = new FileInputStream(oldfile); //读入原文件  
        FileOutputStream fs = new FileOutputStream(new File(%%2,oldfile.getName()));  
        byte[] buffer = new byte[5120];  
        int length;  
        while ( (byteread = inStream.read(buffer)) != -1) {  
          bytesum += byteread; //字节数 文件大小  
          //System.out.println(bytesum);  
          fs.write(buffer, 0, byteread);  
        }  
        inStream.close();  
oldfile.delete();  
      }  
    }  
    catch (Exception e) {  
      System.out.println("复制单个文件操作出错");  
      e.printStackTrace();  
    }  
}  
} 

 

27.指定目录下搜索文件

    private void doSearch(String filter, String path) {  
        File file = new File(path);  
        if(file.exists()) {  
            if(file.isDirectory()) {  
                File[] fileArray = file.listFiles();  
                for(File f:fileArray) {  
                    if(f.isDirectory()) {  
                        doSearch(filter,f.getPath());  
                    } else {  
                        if(f.getName().indexOf(filter) >= 0) {  
                            countFiles++;  
                            result.append(f.getPath() + "\r\n");  
                        }  
                    }  
                    statusShow1.setText(f.getPath());  
                }  
                statusShow2.setText("The numbers of files had been found:" + countFiles);  
            } else {  
                System.out.println("Couldn't open the path!");  
            }  
        } else {  
            System.out.println("The path had been apointed was not Exist!");  
        }  
    }   

 

28.打开对话框

JFileChooser Jfc = new JFileChooser();            //建立选择档案对话方块盒 Jfc  
%%1 = Jfc.getSelectedFile(); 

 

29.文件分割

//import java.io.*  
try {  
File f=new File(%%1);  
FileInputStream fileInputStream = new FileInputStream(f);  
byte[] buffer = new byte[fileInputStream.available()];  
FileInputStream.read(buffer);  
fileInputStream.close();  
String strFileName = f.getName();  
FileOutputStream fileOutputStream = new FileOutputStream(new File(%%2+"\\"+ strFileName + "1"));  
fileOutputStream.write(buffer,0,buffer.length/2);  
fileOutputStream.close();  
fileOutputStream = new FileOutputStream(new File(%%2+"\\"+ strFileName + "2"));  
fileOutputStream.write(buffer, buffer.length/2, buffer.length-buffer.length/2);  
fileOutputStream.close();  
} catch (ArrayIndexOutOfBoundsException e) {  
System.out.print("using FileStreamDemo src des");  
e.printStackTrace();  
}  
catch(IOException e){  
e.printStackTrace();  
}   

 

30.文件合并

//import java.io.*  
String strFileName = %%1.substring(%%1.LastIndexOf("\\") + 1);  
try {  
FileInputStream fileInputStream1 = new FileInputStream(new File(%%2 + strFileName + "1"));  
FileInputStream fileInputStream2 = new FileInputStream(new File(%%2 + strFileName + "2"));  
byte[] buffer = new byte[fileInputStream1.available()+fileInputStream2.available()];  
FileInputStream.read(buffer, 0, fileInputStream1.available());  
FileInputStream2.read(buffer, fileInputStream1.available(), fileInputStream2.available());  
fileInputStream.close();  
fileInputStream2.close();  
FileOutputStream fileOutputStream = new FileOutputStream(new File(%%2+"\\"+ strFileName));  
fileOutputStream.write(buffer,0,buffer.length);  
fileOutputStream.close();  
catch(IOException e){  
e.printStackTrace();  
}   

 

31.文件简单加密

//读文件  
FileStream fsr = new FileStream(%%1, FileMode.Open, FileAccess.Read);  
byte[] btArr = new byte[fsr.Length];  
fsr.Read(btArr, 0, btArr.Length);  
fsr.Close();  
for (int i = 0; i < btArr.Length; i++) //加密  
{  
    int ibt = btArr;  
    ibt += 100;  
    ibt %= 256;  
    btArr = Convert.ToByte(ibt);  
}  
//写文件  
string strFileName = Path.GetExtension(%%1);  
FileStream fsw = new FileStream(%%2+"/" + "enc_" + strFileName, FileMode.Create, FileAccess.Write);  
fsw.Write(btArr, 0, btArr.Length);  
fsw.Close();   

 

32.文件简单解密

FileStream fsr = new FileStream(%%1, FileMode.Open, FileAccess.Read);  
byte[] btArr = new byte[fsr.Length];  
fsr.Read(btArr, 0, btArr.Length);  
fsr.Close();  
for (int i = 0; i < btArr.Length; i++) //解密  
{  
    int ibt = btArr;  
    ibt -= 100;  
    ibt += 256;  
    ibt %= 256;  
    btArr = Convert.ToByte(ibt);  
}  
//写文件  
string strFileName = Path.GetExtension(%%1);  
FileStream fsw = new FileStream(%%2 +"/" + strFileName, FileMode.Create, FileAccess.Write);  
fsw.Write(btArr, 0, btArr.Length);  
fsw.Close();

 


33.文件简单解密

//import java.io.*  
try {  
File f=new File(%%1);  
String strFileName = f.getName();  
FileInputStream fileInputStream = new FileInputStream(%%2+"\\enc_"+strFilename);  
byte[] buffer = new byte[fileInputStream.available()];  
FileInputStream.read(buffer);  
fileInputStream.close();  
for(int i=0;i<buffer.length;i++)  
{  
int ibt=buffer;  
ibt-=100;  
ibt+=256;  
ibt%=256;  
buffer=(byte)ibt;  
}  
FileOutputStream fileOutputStream = new FileOutputStream(f);  
fileOutputStream.write(buffer,0,buffer.length);  
fileOutputStream.close();  
}  
catch(ArrayIndexOutOfBoundException e){  
e.printStackTrace();  
}  
catch(IOException e){  
e.printStackTrace();  
}   

 

34.读取ini文件属性

//import java.io.*  
//import java.util.*;  
//import java.util.regex.*;   
//private HashMap configMap=null;  
private Map configMap=null;  
if(configMap==null) {  
String strLine=null;  
String currentNode=null;  
String previousNode=null;  
Vector vec=new Vector();  
int row=0;  
FileReader fileReader = new FileReader(%%1);  
BufferedReader bufferedReader=new BufferedReader(fileReader);  
try {  
while((strLine=bufferedReader.readLine())!=null) {  
String oneLine=strLine.trim();  
if(oneLine.length()>=1) {  
Pattern p=Pattern.compile("\\[\\s*.*\\s*\\]");  
int nodelen=oneLine.split("[;]").length;  
String[] strArray1=new String[4];  
if(nodelen==1) {  
oneLine=oneLine.split("[;]")[0].trim();  
}  
else if(nodelen==2) {  
strArray1[3]=oneLine.split("[;]")[1].trim();  
oneLine=oneLine.split("[;]")[0].trim();  
}  
Matcher m=p.matche(oneLine);  
if(m.matches()) {  
strArray1[0]="@Node";  
strArray1[1]=oneLine;  
strArray1[2]="";  
} else {  
int keylen=oneLine.split("=").length;  
if(keylen==1) {  
strArray1[0]="@Key";  
strArray1[1]=oneLine.split("=")[0];  
strArray1[2]="";  
} else if(kenlen==2) {  
strArray1[0]="@Key";  
strArray1[1]=oneLine.split("=")[0];  
strArray1[2]=oneLine.split("=")[1];  
} else {  
strArray1[0]="@ElementError";  
strArray1[1]="";  
strArray1[2]="";  
strArray1[3]="";  
}  
}  
if(strArray1[0].equals("@Node")) {  
previousNode=currentNode;  
currentNode=strArray1[1];  
if(row>0) {  
configMap.put(previousNode,vec.elementAt(0));  
//"size:"+configMap.size()  
vec.clear();  
row=0;  
}  
} else if(strArray1[0].equals("@Key") && row==0) {  
Properties ht=new Properties();  
ht.setProperty(strArray1[1],strArray1[2]);  
vec.add(0,ht);  
row++;  
}  
} else if(strArray1[0].equals("@Key") && row>0) {  
Properties ht2=new Properties();  
ht2.put(strArray1[1],strArray1[2]);  
vec.clear();  
vec.add(0,ht2);  
row++;  
}  
}  
}  
configMap.put(currentNode,vec.elementAt(0));  
} catch (FileNotFoundException e) {  
configMap=null;  
e.printStackTrace();  
} catch (IOException e) {  
configMap=null;  
e.printStackTrace();  
} finally {  
vec.clear();  
bufferedReader.close();  
fileReader.close();  
}  
}  
String nodeKey="["+%%2+"]";  
Properties ht=(Properties)configMap.get(nodeKey);  
//"ht:"+ht.toString()  
//"key:"+%%3  
CString %%4=null;  
if(ht.containsKey(%%3)) {  
try {  
%%4=ht.getProperty(%%3);  
} catch (NullPointException e) {  
e.printStackTrace();  
}  
}   

 

35.合并一个文件下所有的文件

File combinefiles=new File(%%1);  
File[] files=combinefiles.listFiles();  
FileOutputStream fs;  
try {  
fs=new FileOutputStream(new File(%%2));  
}  
catch(IOException e){  
e.printStackTrace();  
}  
for(int i=0;i<files.length;i++){  
if(files.isFile()){  
int bytesum=0;  
int byteread=0;  
try {   
FileInputStream inStream=new FileInputStream(files);  
byte[] buffer = new byte[5120];  
int length;  
while((byteread=inStream.read(buffer))!=-1){  
bytesum+=byteread;  
fs.write(buffer,0,byteread);  
}  
inStream.close();  
}  
catch(Exception e){  
//复制文件出错  
e.printStackTrace();  
}  
}  
}  
try {  
fs.close();  
}  
catch(IOException e){  
{  
e.printStackTrace();  
}   

 

36.写入ini文件属性

//import java.io.*  
//import java.util.*;  
//import java.util.regex.*;   
//private HashMap configMap=null;  
private Map configMap=null;  
if(configMap==null) {  
String strLine=null;  
String currentNode=null;  
String previousNode=null;  
Vector vec=new Vector();  
int row=0;  
FileReader fileReader = new FileReader(%%1);  
BufferedReader bufferedReader=new BufferedReader(fileReader);  
try {  
while((strLine=bufferedReader.readLine())!=null) {  
String oneLine=strLine.trim();  
if(oneLine.length()>=1) {  
Pattern p=Pattern.compile("\\[\\s*.*\\s*\\]");  
int nodelen=oneLine.split("[;]").length;  
String[] strArray1=new String[4];  
if(nodelen==1) {  
oneLine=oneLine.split("[;]")[0].trim();  
}  
else if(nodelen==2) {  
strArray1[3]=oneLine.split("[;]")[1].trim();  
oneLine=oneLine.split("[;]")[0].trim();  
}  
Matcher m=p.matche(oneLine);  
if(m.matches()) {  
strArray1[0]="@Node";  
strArray1[1]=oneLine;  
strArray1[2]="";  
} else {  
int keylen=oneLine.split("=").length;  
if(keylen==1) {  
strArray1[0]="@Key";  
strArray1[1]=oneLine.split("=")[0];  
strArray1[2]="";  
} else if(kenlen==2) {  
strArray1[0]="@Key";  
strArray1[1]=oneLine.split("=")[0];  
strArray1[2]=oneLine.split("=")[1];  
} else {  
strArray1[0]="@ElementError";  
strArray1[1]="";  
strArray1[2]="";  
strArray1[3]="";  
}  
}  
if(strArray1[0].equals("@Node")) {  
previousNode=currentNode;  
currentNode=strArray1[1];  
if(row>0) {  
configMap.put(previousNode,vec.elementAt(0));  
//"size:"+configMap.size()  
vec.clear();  
row=0;  
}  
} else if(strArray1[0].equals("@Key") && row==0) {  
Properties ht=new Properties();  
ht.setProperty(strArray1[1],strArray1[2]);  
vec.add(0,ht);  
row++;  
}  
} else if(strArray1[0].equals("@Key") && row>0) {  
Properties ht2=new Properties();  
ht2.put(strArray1[1],strArray1[2]);  
vec.clear();  
vec.add(0,ht2);  
row++;  
}  
}  
}  
configMap.put(currentNode,vec.elementAt(0));  
} catch (FileNotFoundException e) {  
configMap=null;  
e.printStackTrace();  
} catch (IOException e) {  
configMap=null;  
e.printStackTrace();  
} finally {  
vec.clear();  
bufferedReader.close();  
fileReader.close();  
}  
}  
String nodeKey="["+%%2+"]";  
Properties ht=null;  
if(configMap.containsKey(nodeKey)) {  
ht=(Properties)configMap.get(nodeKey);  
} else {  
ht=(Properties)configMap.get(nodeKey,%%3);  
}  
try {  
ht.setProperty(%%3,%%4);  
} catch (NullPointException e) {   
e.printStackTrace();  
}  
FileWriter fw = new FileWriter(%%1);  
BufferedWriter bw=new BufferedWriter(fw);  
Set keys=configMap.keySet();  
Iterator ite=keys.iterator();  
while(ite.hasNext()) {  
String oneKey=(String)ite.next();  
bw.WriteLine(oneKey);  
ht=(Properties)configMap.get(oneKey);  
ht.list(new PrintWriter(bw,true));  
}

 

37.获得当前路径

this.getClass().getResource("/").getPath()

 

38.读取XML数据库

//import java.io.*;  
//import javax.xml.parsers.*;  
//import org.xml.sax.*;  
//import org.w3c.dom.*;  
private Document document;  
File xml_file=new File(%%1);  
DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();  
try {  
DocumentBuilder builder=factory.newDocumentBuilder();  
document=builder.parse(xml_file);  
} catch(Exception e) {  
e.printStackTrace();  
}  
String subNodeTag=%%2;  
Element rootNode=document.getDocumentElement();  
//%%2="serverList" //%%4="id" //%%6="port"  
//%%3="server" //%%5="ipaddr"  
NodeList nlist=rootNode.getElementsByTagName(subNodeTag);  
int len=nlist.getLength();  
Node x=null;  
for(int i=0;i<len;i++) {  
x=nlist.item(i);  
String getNodeAttrValue=null;  
NamedNodeMap attrList=node.getAttributes();  
for(int j=0;j<attrList.getLength();j++) {  
if(attrList.item(j).getNodeName().compareTo(%%7)==0) {  
getNodeAttrValue=attrList.item(j).getNodeValue();  
break;  
}  
}  
if(getNodeAttrValue.compareTo(%%8)==0)  
break;  
}  
String %%9=null;  
if(x!=null) {  
NodeList nlist=node.getChildNodes();  
int len=nlist.getLength();  
Node currentNode;  
String nodeName;  
for(int i=0;i<len;i++) {  
currentNode=nlist.item(i);  
nodeName=currentNode.getNodeName();  
if(nodeName.equals(%%5)==0) {  
%%9=document.getElementValue(currentNode);  
break;  
}  
}  
}   

 

39.写入XML数据库

//import java.io.*;  
//import javax.xml.parsers.*;  
//import org.xml.sax.*;  
//import org.w3c.dom.*;  
//import javax.xml.transform.*;  
//import javax.xml.transform.dom.*;  
//import javax.xml.transform.stream.*;  
private Document document;  
private Element node;  
File xml_file=new File(%%1);  
DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();  
try {  
DocumentBuilder builder=factory.newDocumentBuilder();  
document=builder.parse(xml_file);  
} catch(Exception e) {  
e.printStackTrace();  
}  
String subNodeTag=%%2;  
Element rootNode=document.getDocumentElement();  
//%%2="serverList" //%%4="id" //%%6="port"  
//%%3="server" //%%5="ipaddr"  
NodeList nlist=rootNode.getElementByTagName(subNodeTag);  
node=document.createElement(%%3);  
node.setAttribute(%%4,nlist.getLength()+1).toString());  
node.appendChild(document.createTextNode("\n");  
Element ipNode=document.createElement(%%5);  
ipNode.appendChild(document.createTextNode(%%8));  
node.appendChild(ipNode);  
node.appendChild(document,createTextNode("\n");  
Element port=document.createElement(%%6);  
port.appendChild(document.createTextNode(%%9));  
node.appendChild(port);  
node.appendChild(document,createTextNode("\n");  
nlist.appendChild(node);  
TransformerFactory tFactory=TransformerFactory.newInstance();  
Transformer transformer=null;  
try {  
transformer=tFactory.newTransformer();  
DOMSource source=new DOMSource(document);  
StreamResult result=new StreamResult(xml_file);  
transformer.transform(source,result);  
} catch(Exception e) {  
e.printStackTrace();  
} 

 

40.ZIP压缩文件

//import java.io.*;  
//import java.util.zip.*;  
//创建文件输入流对象  
FileInputStream fis=new FileInputStream(%%1);  
//创建文件输出流对象  
FileOutputStream fos=new FileOutputStream(%%2);  
//创建ZIP数据输出流对象  
ZipOutputStream zipOut=new ZipOutputStream(fos);  
//创建指向压缩原始文件的入口  
ZipEntry entry=new ZipEntry(args[0]);  
zipOut.putNextEntry(entry);  
//向压缩文件中输出数据  
int nNumber;  
byte[] buffer=new byte[1024];  
while((nNumber=fis.read(buffer))!=-1)  
zipOut.write(buffer,0,nNumber);  
//关闭创建的流对象  
zipOut.close();  
fos.close();  
fis.close();  
}  
catch(IOException e)   
{  
System.out.println(e);  
}

 

41.ZIP解压缩

//import java.io.*;  
//import java.util.zip.*;  
try{  
//创建文件输入流对象实例  
FileInputStream fis=new FileInputStream(%%1);  
//创建ZIP压缩格式输入流对象实例  
ZipInputStream zipin=new ZipInputStream(fis);  
//创建文件输出流对象实例  
FileOutputStream fos=new FileOutputStream(%%2);  
//获取Entry对象实例  
ZipEntry entry=zipin.getNextEntry();  
byte[] buffer=new byte[1024];  
int nNumber;  
while((nNumber=zipin.read(buffer,0,buffer.length))!=-1)  
fos.write(buffer,0,nNumber);  
//关闭文件流对象  
zipin.close();  
fos.close();  
fis.close();  
}  
catch(IOException e) {  
System.out.println(e);  
} 

 

42.递归删除目录中的文件

//import java.io.*;  
//import java.util.*;  
ArrayList<String> folderList = new ArrayList<String>();  
folderList.add(%%1);  
for (int j = 0; j < folderList.size(); j++) {  
File file = new File(folderList.get(j));  
File[] files = file.listFiles();  
ArrayList<File> fileList = new ArrayList<File>();  
for (int i = 0; i < files.length; i++) {  
if (files.isDirectory()) {  
folderList.add(files.getPath());  
} else {  
fileList.add(files);  
}  
}  
for (File f : fileList) {  
f.delete();  
}  
}

 

43.ZIP压缩文件夹

//import java.io.*;  
//import org.apache.tools.zip.ZipOutputStream; //这个包在ant.jar里,要到官方网下载  
//import java.util.zip.*;  
try {  
String zipFileName = %%2; //打包后文件名字  
File f=new File(%%1);  
ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFileName));  
String base= "";  
if (f.isDirectory()) {  
   File[] fl = f.listFiles();  
   out.putNextEntry(new org.apache.tools.zip.ZipEntry(base + "/"));  
   base = base.length() == 0 ? "" : base + "/";  
   for (int i = 0; i < fl.length; i++) {  
   zip(out, fl, base + fl.getName());  
}  
}else {  
   out.putNextEntry(new org.apache.tools.zip.ZipEntry(base));  
   FileInputStream in = new FileInputStream(f);  
   int b;  
   while ( (b = in.read()) != -1) {  
    out.write(b);  
}  
in.close();  
}  
out.close();  
}catch (Exception ex) {  
   ex.printStackTrace();  
} 

 

44.Java验证DTD

try   {   
      InputStream   in=new   FileInputStream(filePath);       
SAXReader   saxReader   =   new   SAXReader();   
this.document   =   saxReader.read(in);         
DocumentBuilderFactory       factory       =       null;     
factory       =       DocumentBuilderFactory.newInstance();         
    //进行dtd检查         
factory.setValidating(true);         
}   catch   (Exception   e)   {   
}

 

45.验证Schema 

String xsdFileName = \"Q:\\\\_dev_stu\\\\xsdtest\\\\src\\\\note.xsd\";   
try {   
//创建默认的XML错误处理器   
XMLErrorHandler errorHandler = new XMLErrorHandler();   
//获取基于 SAX 的解析器的实例   
SAXParserFactory factory = SAXParserFactory.newInstance();   
//解析器在解析时验证 XML 内容。   
factory.setValidating(true);   
//指定由此代码生成的解析器将提供对 XML 名称空间的支持。   
factory.setNamespaceAware(true);   
//使用当前配置的工厂参数创建 SAXParser 的一个新实例。   
SAXParser parser = factory.newSAXParser();   
//创建一个读取工具   
SAXReader xmlReader = new SAXReader();   
//获取要校验xml文档实例   
Document xmlDocument = (Document) xmlReader.read(new File(xmlFileName));   
//设置 XMLReader 的基础实现中的特定属性。核心功能和属性列表可以在 http://sax.sourceforge.net/?selected=get-set 中   
  
找到。   
parser.setProperty(   
\"http://java.sun.com/xml/jaxp/properties/schemaLanguage",   
\"http://www.w3.org/2001/XMLSchema");   
parser.setProperty(   
\"http://java.sun.com/xml/jaxp/properties/schemaSource",   
\"file:\" + xsdFileName);   
//创建一个SAXValidator校验工具,并设置校验工具的属性   
SAXValidator validator = new SAXValidator(parser.getXMLReader());   
//设置校验工具的错误处理器,当发生错误时,可以从处理器对象中得到错误信息。   
validator.setErrorHandler(errorHandler);   
//校验   
validator.validate(xmlDocument);   
  
XMLWriter writer = new XMLWriter(OutputFormat.createPrettyPrint());   
//如果错误信息不为空,说明校验失败,打印错误信息   
if (errorHandler.getErrors().hasContent()) {   
     System.out.println(\"XML文件通过XSD文件校验失败!\");   
     writer.write(errorHandler.getErrors());   
} else {   
     System.out.println(\"Good! XML文件通过XSD文件校验成功!\");   
}   
} catch (Exception ex) {   
System.out.println(\"XML文件: \" + xmlFileName + \" 通过XSD文件:\" + xsdFileName + \"检验失败。\n原因: \" + ex.getMessage   
  
());   
ex.printStackTrace();   
}   
     }

 

46.Grep

//import java.util.regex.Pattern;   
//import java.util.regex.Matcher;   
//import java.io.FileReader;   
//import java.io.BufferedReader;   
//import java.io.IOException;   
  
/**  
* Simple implementation of the ubiquitous grep command.  
* First argument is the regular expression to search for (remember to  
* quote and/or escape as appropriate). All following arguments are  
* filenames to read and search for the regular expression.  
*  
* Created: April, 2002  
* @author Ron Hitchens (ron@ronsoft.com)  
* @version $Id: SimpleGrep.java,v 1.1 2002/05/07 02:21:08 ron Exp $  
*/   
public static void main (String [] argv)   
throws Exception   
{   
if (argv.length < 2) { // 如果参数行没有输入参数,结束程序   
System.out.println ("Usage: regex file [ ... ]");   
return;   
}   
  
Pattern pattern = Pattern.compile (argv [0]); // 第一个参数为需要匹配的字符串   
Matcher matcher = pattern.matcher ("");   
  
// 一次读取各个文件   
for (int i = 1; i < argv.length; i++) {   
String file = argv ; // 第2个参数开始,均为文件名。   
BufferedReader br = null;   
String line;   
  
try {   
br = new BufferedReader (new FileReader (file)); // 打开文件   
} catch (IOException e) {   
// 没有打开文件,则产生异常   
System.err.println ("Cannot read '" + file   
+ "': " + e.getMessage());   
continue;   
}   
  
while ((line = br.readLine()) != null) { // 读入一行,直到文件结束   
matcher.reset (line); // 匹配字符串   
  
if (matcher.find()) { // 如果有匹配的字符串,则输出   
System.out.println (file + ": " + line);   
}   
}   
  
br.close(); // 关闭文件  
} 

 

分享到:
评论

相关推荐

    java文件操作大全

    java文件操作大全

    Java文件操作大全.rar_文件操作

    `Java文件操作大全 (3).txt、Java文件操作大全 (1).txt、Java文件操作大全 (2).txt`这些文档很可能是教程的章节,逐步讲解各个知识点。而`www.pudn.com.txt`可能是一个示例文件或参考资料链接。 总的来说,这...

    《Java文件操作大全》电子书

    《Java文件操作大全》电子书 本文汇集常用文件操作方法,包括文件的建立/检查与删除,目录的建立/检查与删除,取出目录中文件,文件属性的取得,逐行读取数据等等。

    影刀RPA中级证书-数据处理-列表计算价格

    影刀RPA致力于为各行业客户提供高效、灵活的自动化解决方案。能够实现PC、手机上任何软件的自动化操作,支持Windows、Linux等操作系统,以及桌面软件、Web程序和手机App的自动化。 影刀RPA的核心功能包括数据抓取、解析、校验和自动填表,还支持可视化流程设计器、Python和JavaScript脚本接入,以及流程录制等功能,帮助用户快速搭建自动化流程。影刀RPA结合AI技术,支持机器视觉、自然语言处理等高级功能,进一步提升自动化能力。影刀RPA广泛应用于电商、金融、制造等行业,帮助客户实现订单处理、客户数据录入、财务对账等任务的自动化。影刀实战,影刀证书快速获取,影刀功能定制

    cloud单点登录集成

    cloud单点登录集成

    JAVAFX开发的虚拟桌宠,禁止商用!!!!

    女朋友生日,突发奇想用她喜欢的表情包做了个虚拟桌宠 大家要用只需要替换一下GIF就行

    大学生创新创业大赛项目 - 仿 Envato 的电商项目.zip

    大学生创业项目源码

    open-vm-tools-11.0.5-3.el7-9.9.x64-86.rpm.tar.gz

    1、文件内容:open-vm-tools-11.0.5-3.el7_9.9.rpm以及相关依赖 2、文件形式:tar.gz压缩包 3、安装指令: #Step1、解压 tar -zxvf open-vm-tools-11.0.5-3.el7_9.9.tar.gz #Step2、进入解压后的目录,执行安装 sudo rpm -ivh *.rpm 4、更多资源/技术支持:公众号禅静编程坊

    华为网路设备学习-14 (web界面中复原防火墙实验)

    华为网路设备学习-14 (web界面中复原防火墙实验)

    基于springboot框架的Javaweb体育馆管理系统的设计与实现(完整源码+数据库sql文件+项目文档+Java项目编程实战+编程练手好项目).zip

    关键词:海滨体育馆管理,Java技术,MYSQL数据库,Spring Boot框架 1 引言 1 1.1 课题背景 1 1.2 设计原则 1 1.3 论文结构安排 2 2 系统关键技术 3 2.1 JAVA技术 3 2.2 B/S结构 3 2.3 MYSQL数据库 4 2.4 Spring Boot框架 4 3 系统分析 5 3.1 可行性分析 5 3.1.1 技术可行性 5 3.1.2 经济可行性 5 3.1.3 运行可行性 5 3.1.4 法律可行性 5 3.2 系统性能分析 5 3.3 系统功能分析 6 3.4 系统流程分析 7 3.4.1 注册登录流程 7 3.4.2 添加信息流程 8 3.4.3 删除信息流程 8 4 系统设计 9 4.1 系统概要设计 9 4.2 系统结构设计 9 4.3 系统顺序图设计 10 4.4 数据库设计 10 4.4.1 数据库E-R图设计 10 4.4.2 数据库表设计 12 5 系统的实现 15 5.1 登录模块的实现 15 5.2 注册模块的实现 15 5.3 学生管理模块的实现 16 5.4 系统主界面模块的实现 16 5.5 器材管理模块

    Python实现基于IBES-ELM基于改进的秃鹰搜索优化算法优化极限学习机的数据回归预测 多指标的详细项目实例(含完整的程序,GUI设计和代码详解)

    内容概要:本文档详细介绍了一个名为《Python实现基于IBES-ELM基于改进的秃鹰搜索优化算法优化极限学习机的数据回归预测》的项目。该项目旨在通过结合改进的秃鹰搜索优化算法(IBES-EO)和极限学习机(ELM),优化ELM模型以提高其预测精度,尤其针对多指标、高维数据以及噪声数据的处理进行了探讨。项目涵盖了从数据预处理到建模预测的一系列完整流程,并提供了代码案例和GUI界面设计思路。文档详细阐述了模型的工作机制、适用场景及其实现细节。 适合人群:对机器学习有兴趣,特别是对ELM、IBES-EO感兴趣的研究人员、开发人员和技术爱好者。 使用场景及目标:适用于各种回归预测问题,包括但不限于金融预测、气象预测、健康数据分析和智能交通系统等。目标在于提供一种高效的解决方案,提高在大规模复杂数据集中进行回归预测的能力,同时也展示了如何将生物启发式的优化算法运用于改进现有的机器学习模型,为实际应用提供更多可能。 阅读建议:文档按照章节顺序编排,从背景介绍到具体实现再到最终总结。初学者可以从头至尾通读,以掌握全流程概念和技能;有一定经验的读者可以直接跳转至自己感兴趣的环节,例如优化算法的具体设计或者代码实现部分。建议边学习边动手实验,以达到最佳的学习效果,并可通过提供的完整示例代码加深理解和记忆。此外,项目中有关于系统架构设计、API接口搭建等内容也可作为实际工程项目参考。

    智能海报设计助手:AI助力简易高效的海报制作解决方案

    内容概要:本文介绍了一款名为智能海报设计助手的应用程序,该应用程序是一款面向大众使用的AI工具,专注于解决普通人在设计高质量海报时遇到的问题。应用程序拥有强大的创意灵感库,可以根据用户提出的特定需求(例如主题、风格偏好等),快速推荐不同类型的海报设计方案,并配备智能化的一键素材筛选系统和自动排版功能,使得整个海报制作流程更为简化、高效,即使是无设计经验的用户也能独立完成高水平的作品。 适合人群:缺乏专业设计能力的广大非专业人士,如商家营销人员、活动策划者、个体创作者。 使用场景及目标:帮助需要短时间内完成海报宣传材料准备的工作人士提高工作效率,减少人力投入的同时获得媲美专业人士水准的成品。 阅读建议:文章旨在强调此智能海报设计器对普通用户的友好性和便捷性的特点,因此重点在于理解它是怎样利用先进技术来满足一般用户的实际应用需求的,而不仅仅关注具体的操作方法。这有助于潜在用户决定是否采用这一工具来进行海报创建工作。

    STL浅谈,从vector到map

    本文为C++ STL入门指南,详解vector、stack、map等核心容器的用法与底层原理,助你高效掌握标准模板库!

    大创项目驱动.zip

    大学生创业项目源码

    西门子S71511PLC实现PID程序控制阀门开度和模拟量转换:博途WinCC画面搭建完整演示,西门子S71511PLC实现PID程序控制阀门开度和模拟量转换:博途WinCC画面搭建完整演示,7自由度

    西门子S71511PLC实现PID程序控制阀门开度和模拟量转换:博途WinCC画面搭建完整演示,西门子S71511PLC实现PID程序控制阀门开度和模拟量转换:博途WinCC画面搭建完整演示,7自由度车辆动力学模型与联合仿真验证 软件使用:Carsim2020.0+Matlab Simulink2018b 适用场景:为了验证7自由度模型的正确性,与Carsim进行联合仿真验证,采用模块化建模方法,搭建了电机模型、参数计算、轮胎模型、7自由度动力学模型。 包含模块:电机模型模块1和2、参数计算模块、轮胎模型、7DOF模型、详细参考文献及说明文档。 包含:Matlab Simulink源码文件,详细建模说明文档,对应参考资料及相关文献, ,7自由度车辆动力学模型;联合仿真验证;Carsim2020.0;Matlab Simulink2018b;模块化建模方法;电机模型;参数计算模块;轮胎模型;详细参考文献;建模说明文档。,7自由度车辆模型联合仿真验证:Carsim2020.0与Matlab Simulink2018b应用实践

    【css酷炫效果】纯CSS实现立体纸张折叠动效

    对应博客地址:https://blog.csdn.net/u011561335/article/details/146313054

    大创项目前端.zip

    大学生创业项目源码

    大创项目_27.zip

    大学生创业项目源码

    【毕业设计】基于微信小程序的社区团购系统+ssm后端【源码+论文+答辩ppt+开题报告+任务书】.zip

    【项目资源】:包含前端、后端、移动开发、操作系统、人工智能、物联网、信息化管理、数据库、硬件开发、大数据、课程资源、音视频、网站开发等各种技术项目的源码。包括STM32、ESP8266、PHP、QT、Linux、iOS、C++、Java、MATLAB、python、web、C#、EDA、proteus、RTOS等项目的源码。 【项目质量】:所有源码都经过严格测试,可以直接运行。功能在确认正常工作后才上传。 【适用人群】:适用于希望学习不同技术领域的小白或进阶学习者。可作为毕设项目、课程设计、大作业、工程实训或初期项目立项。 【附加价值】:项目具有较高的学习借鉴价值,也可直接拿来修改复刻。对于有一定基础或热衷于研究的人来说,可以在这些基础代码上进行修改和扩展,实现其他功能。 【沟通交流】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。鼓励下载和使用,并欢迎大家互相学习,共同进步。

Global site tag (gtag.js) - Google Analytics