http://expert.csdn.net/Expert/topic/1367/1367962.xml?temp=.6640436
解决方案 »
- 主机屋免费空间在网页中动态插入free_ad.js;此举让我心寒
- Hibernate operation: could not insert: 急问
- 急,在线等!!关于页面的显示记录语句的逻辑QQ:315953206
- 一个关于TOMCAT的奇怪问题
- 高手进来帮帮忙吧(小弟穷了没分了,好心人进来看看)
- 页面的气泡提示效果
- 关于拍卖商品时间控制的问题,高分求解
- 用frameset时一个frame怎样刷新另一个frame~~~~~~~~~急,急急急
- 用jsp怎么和sql server 2000连接阿?????????
- 求助:redis哨兵部署,哨兵之间不能相互通信,哨兵不能发现slave
- 关于session的问题
- 请问:怎样实现把一个jsp页面提交给一个servlet?(再线等)
File file=null;
public test() {
try {
file=new File("c:/beyond_xiruo");
if(!file.exists())//如果不存在就创建该目录
file.mkdirs();
file=new File("c:/beyond_xiruo/note.txt");
if(!file.exists())
file.createNewFile();
}catch(Exception e){System.out.println(e.toString());}
this.start();
}
public void run() {
try{
String str="abcdefghijklmnopqrstuvwxyz";
int i=0;
java.io.BufferedReader br=null;
java.io.BufferedWriter bw=null;
String s="";
while(true) {
br=new java.io.BufferedReader(new FileReader(file));
String s1="";
while((s1=br.readLine())!=null) {
s+=s1;
}
s+="\t"+str.substring(i,i+1);
System.out.println(s);
bw=new java.io.BufferedWriter(new FileWriter(file));
bw.write(s);
i++;
if(i>=str.length())
break;
this.sleep(100);//定时为100毫秒往文件里写一个字符
}
br.close();
bw.close();
}catch(Exception e){System.out.println(e.toString());}
}
//Main method
public static void main(String[] args) {
new test();
}
}