如何在JSP / Java中生成唯一ID然后输入到文本中,我已经注意使用UDDID但是我希望它是1,2,3,4,5,6,7,8等。
输出当前输入代码如下
<%
String name = request.getParameter("name");
String question = request.getParameter("question");
java.util.Date date = new java.util.Date();
String file_name = "form.txt";
try{
ReadFile file = new ReadFile(file_name);
String[] aryLines = file.OpenFile();
int i;
for(i=0; i< aryLines.length; i++);
}
catch (IOException e){
System.out.println("Sorry,not accepted");
}
WriteFile fileWriter = new WriteFile(file_name, true);
fileWriter.writeToFile(name+","+question+","+date+","+"Pending");
%>
非常感谢