其实这个文章代表了俺的罪孽...
俗话说:好逸恶劳是罪孽啊
....我的时间啊...
---------------------------------------------------------------------------------
1 需求分析:
a 功能需求:在上班的时候很无聊,没有事情做又不能随便干点啥,想看小说有容易入神后被项目经理发现,实在是老太太磕麦芽糖,实在很不爽,我们需要一个可以光明正大的看小说的工具
b 环境需求:windows xp,vista容易卡,在切换到其他程序时,容易卡死而吐血身亡
2 可行性分析:
a 技术可行性:目前小说txt版本资源十分富足,而且txt桌面阅读程序更是......茅草一般多
b 财务可行性:没有成本
c 经济可行性:看小说还挣工资,非常可行
d 风险因素及对策: 被公司领导发现的风险,对策:今天的目标就是不让发现!!被发现了就去撞墙吧!
3 详细设计
针对需求低暴露高隐蔽性的特点,又要保证读者相对的舒适和放心度.
我们 的 运行环境采用eclipse.
eclipse 是目前java程序员使用比较多的IDE,而且支持插件管理使用,可以自由扩展功能,实在是太适合看小说啦
4 具体实现
a 首先选择合适的插件,如果各位打算自己实现,我最多就吐吐口水而已...
最终选择插件 notepad
下载地址:http://sourceforge.net/projects/eclipsenotepad/
此插件支持编辑文字,和自动换行,完全满足偶们的需要
b 添加插件.把下好的压缩包解压缩,将plugin和feature两个文件夹复制到eclipse <script src="/javascripts/tinymce/themes/advanced/langs/zh.js" type="text/javascript"></script> <script src="/javascripts/tinymce/plugins/javaeye/langs/zh.js" type="text/javascript"></script> 目录下,...
5 用户说明书
a 打开 <script src="/javascripts/tinymce/themes/advanced/langs/zh.js" type="text/javascript"></script> <script src="/javascripts/tinymce/plugins/javaeye/langs/zh.js" type="text/javascript"></script> eclipse
b window---->showVIew----->other---->NodePad--->nodepad菜单
c 将nodepad 的panel拖曳到你喜欢或者认为非常安全的位置,
比如Navigator的下方......~~~~
d 将小说粘进去...
搞定,如果有情况,迅速f4键,切换到Hierarchy面板,nodepad就被挡住拉,不挡住也没什么看的出来...
上面是第一种方案:
下面是trueck 的方案,更加萎缩yd,和无耻...
- URL url = new URL("http://files.qidian.com/Author8/151399/4059241.txt");
- URLConnection urlconn = url.openConnection();
- DataInputStream dis = new DataInputStream(urlconn.getInputStream());
- String inputLine;
- while((inputLine = dis.readLine()) != null){
- String temp = new String(inputLine.getBytes("ISO-8859-1"));
- String [] arr = temp.split("<p>");
- for(String tt : arr)
- System.out.println(tt);
- }
- dis.close();
URL url = new URL("http://files.qidian.com/Author8/151399/4059241.txt");
URLConnection urlconn = url.openConnection();
DataInputStream dis = new DataInputStream(urlconn.getInputStream());
String inputLine;
while((inputLine = dis.readLine()) != null){
String temp = new String(inputLine.getBytes("ISO-8859-1"));
String [] arr = temp.split("<p>");
for(String tt : arr)
System.out.println(tt);
}
dis.close();
把控制台缩成一行大小,在打印时断点,按F8一行一行看
不过通过网络还是有会被公司的过滤器发现的可能,尤其是大公司,所以先吧txt下载下来,然后在本地看吧
- import org.apache.commons.io.FileUtils;
- public class run {
- public static void main(String[] args) {
- ResourceBundle resources = ResourceBundle.getBundle("file");
- String path = resources.getString("filepath");
- String name = resources.getString("filename");
- File file = new File(path,name);
- try {
- List lines = FileUtils.readLines(file, "gbk");
- int i = 0;
- for (Iterator iter = lines.iterator(); iter.hasNext();) {
- i++;
- String str = iter.next().toString();
- System.out.println(str);
- iter.remove();
- if(i == 100){
- FileUtils.writeLines(file, "gbk", lines);
- i=0;
- }
- }
- } catch (IOException e) {
- System.err.println("wro");
- }
- }
- }
import org.apache.commons.io.FileUtils;
public class run {
public static void main(String[] args) {
ResourceBundle resources = ResourceBundle.getBundle("file");
String path = resources.getString("filepath");
String name = resources.getString("filename");
File file = new File(path,name);
try {
List lines = FileUtils.readLines(file, "gbk");
int i = 0;
for (Iterator iter = lines.iterator(); iter.hasNext();) {
i++;
String str = iter.next().toString();
System.out.println(str);
iter.remove();
if(i == 100){
FileUtils.writeLines(file, "gbk", lines);
i=0;
}
}
} catch (IOException e) {
System.err.println("wro");
}
}
}
如果想看完的以后就不用看了, if(i == 100){ 这行去掉^_^