public String ReadFile(String s_FileName) {
String s_Result = "";
BufferedReader buf;
try {
buf = new BufferedReader(new InputStreamReader(new FileInputStream(s_FileName), "UTF-8"));
String line = null;
int flag = 1;
while ((line = buf.readLine()) != null) {
if (flag == 1) {
line = line.substring(1);// 去掉文件头
flag++;
}
s_Result += line;
}
buf.close();
} catch (UnsupportedEncodingException e) {
System.out.println(e.getMessage());
} catch (FileNotFoundException e) {
System.out.println(e.getMessage());
} catch (IOException e) {
System.out.println(e.getMessage());
}
return s_Result;
}


![[C#]采集网页图片采集程序[原创]](http://www.chendw.cn/wp-content/uploads/2008/07/2cb95fa7c6f940b391b5b3cdef52e29a.jpg)