键盘记录小程序

来源:互联网 发布:方维o2o源码下载 编辑:程序博客网 时间:2024/06/05 06:26
 
package net;

/**
 * 
@author blurxx
 * 
@version 1.0
 
*/

 
import java.io.FileWriter;
import java.io.IOException;
import java.io.*;

class FileWrite 
{
   
public static void main(String args[]) 
   
{
      StringBuffer buf
=new StringBuffer();
      
try 
     
{
         FileOutputStream out
=new FileOutputStream("text.txt",true);
         BufferedOutputStream reader
=new BufferedOutputStream(out);
         
char c;
         
while((c = (char)System.in.read()) != ' '
      
{
            buf.append(c);
         }

         
byte b[]=buf.toString().trim().getBytes("ISO8859_1");

Title: reader


 *
 * 

Description: 


 *
 * 

Copyright: Copyright (c) 2007


 *
 * 

Company: 


 *
 * 
         reader.flush();
         reader.write(b,
0,b.length);
         reader.close();
      }

      
catch(IOException e) 
     
{
         System.out.println(
"读写操作出现异常!");
         System.exit(
-1);
      }

   }

}


原创粉丝点击