随机生成二维码链接并保存到本地

public class UUIDTestRandom {

private static final String fileName = "D://data.txt";
private static final String fileName1 = "D://data1.txt";
@Test
public void ttt() throws IOException{
File file = new File(fileName);
File file1 = new File(fileName1);
BufferedWriter ow = new BufferedWriter(new FileWriter(file));
BufferedWriter ow1 = new BufferedWriter(new FileWriter(file1));

// Des desObj = new Des();
for(int i=1;i<2011;i++){
String randoms=UUID.randomUUID().toString();
ow.write(randoms+"\r\n");
ow1.write("http://wapsn.189.cn/ErWeiMaLianJieServlet?encodeStr="+randoms+"\r\n");
//System.out.println("第"+i+"个加密二维码链接为:="+desObj.strEnc(randoms,"1","2","3"));
//desObj.strDec(accNum1,"1","2","3");
}
ow.close();
ow1.close();


/*try {
String path = "d:\\1.text";//文件保存路径、名字
File file = new File(path);
BufferedWriter ow = new BufferedWriter(new FileWriter(file));
String s = "内容";//写入内容
ow.write(s);
ow.close();
} catch (Exception e) {
e.printStackTrace();
}*/
}


}

转载于:https://www.cnblogs.com/qxqbk/p/7117590.html

你可能感兴趣的:(随机生成二维码链接并保存到本地)