JAVA generates letters and random numbers and files. java generates letters.
Package com. ishow. control. code; import java. io. *; import java. text. simpleDateFormat; import java. util. random;/*** @ author Lee * @ version Creation Time: Oct 9, 2015 4:12:25 PM */public class CreateCodeController {/*** generate a redemption Code * @ return * @ throws IOException */public static void main (String [] args) {Long start = System. currentTimeMillis (); String prefix = "LF"; // prefix: int num = 10; // number of digits: int count = 10000; // generate the number of SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH mm"); // generate the File address File f = new File ("C: \ Documents and Settings \ Administrator \ Desktop \ generate code "+ formatter. format (System. currentTimeMillis () + ". txt "); OutputStreamWriter writer = null; BufferedWriter bw = null; Random random = new Random (); try {OutputStream OS = new FileOutputStream (f ); writer = new OutputStreamWriter (OS); bw = new BufferedWriter (writer); int I = 0; while (I <count) {String str = ""; for (int j = 0; j <num; j ++) {int number = random. nextInt (10); str + = number + "";} str = prefix + str; try {bw. write (str + "\ r \ n");} catch (Exception e) {I --;} I ++;} bw. flush ();} catch (FileNotFoundException e) {e. printStackTrace ();} catch (IOException e) {e. printStackTrace ();} finally {try {bw. close ();} catch (IOException e) {e. printStackTrace () ;}long end = System. currentTimeMillis (); System. out. println ("bufferedWrite And FileWriterTest's time ---------" + (start-end)/1000d );}}