package com.test;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
public class FileTest {
public static void main(String[] args) throws Exception {
BufferedReader v=new BufferedReader(new InputStreamReader(new FileInputStream(new File("c:/Login.java")), "GBK"));
String txt="";
StringBuffer s=new StringBuffer();
while ((txt=v.readLine())!=null) {
s.append(txt);
}
System.err.println(s);
}
}
代码正中下怀