• 团队第二阶段个人冲刺day04


    今天实现了从文本文件中读取停用词到数组中,

    package shunxu;

    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    import java.io.InputStreamReader;

    public class test {
    public static String txt2String(File file){
    StringBuilder result = new StringBuilder();
    try{

    InputStreamReader isr = new InputStreamReader(new FileInputStream(file), "UTF-8");
    BufferedReader br = new BufferedReader(isr);//构造一个BufferedReader类来读取文件
    String s = null;
    while((s = br.readLine())!=null){//使用readLine方法,一次读一行
    result.append(System.lineSeparator()+s);
    }
    br.close();
    }catch(Exception e){
    e.printStackTrace();
    }
    return result.toString();
    }

    public static void main(String[] args){
    File file = new File("E:\StopWords\StopWords.txt");//我的txt文本存放目录,根据自己的路径修改即可

    try{
    String s = "";
    InputStreamReader isr = new InputStreamReader(new FileInputStream("E:\StopWords\StopWords.txt"), "UTF-8");
    BufferedReader in =new BufferedReader(isr);
    while((s=in.readLine())!=null){
    String[] split = s.split(",");
    /*for(int i=0;i<split.length;i++)

    {

    System.out.println(split[i]);

    }*/
    }
    }catch(FileNotFoundException e){
    e.printStackTrace();
    }
    catch(IOException e){
    e.printStackTrace();
    }
    }
    }

  • 相关阅读:
    Kindeditor 代码审计
    tamper参数
    大学站注入点(安全狗)
    sqlmap注入小结
    tamper绕WAF详解
    网站安全狗最新版绕过测试
    大学站防SQL注入代码(ASP版)
    防SQL注入代码(ASP版)
    xss利用和检测平台
    tamper绕WAF小结
  • 原文地址:https://www.cnblogs.com/lxywsx/p/14910634.html
Copyright © 2020-2023  润新知