package com.moyuanqi;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.Date;
public class Programlist {
public static void main(String[] args) {
// File file = new File("D:\\800", "index.txt");
File f = new File("D:\\800", "index.txt");
Date nowDate = new Date();
RandomAccessFile in;
try {
in = new RandomAccessFile(f, "r");
long filePoint = 0;
long fileLength = in.length();
int i = 0, cont = 0;
while (filePoint < fileLength) {
String str = in.readLine();
i = i + 1;
cont = cont + 1;
if (cont % 35 == 0) {
System.out.println("/*********************************页号: "
+ cont / 35 + " 源程序名:" + f.getName() + " 时间是: "
+ nowDate + "***********************************/");
System.out.println("*********************************************************************************************************************************************");
}
System.out.println(i + " " + str);
filePoint = in.getFilePointer();
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}