通过keys.xx事件读取文本文件中的下一行/上一行 [英] read next line / previous line in a text file by keys.xx events

查看:107
本文介绍了通过keys.xx事件读取文本文件中的下一行/上一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过keys.xx事件阅读文本文件中的下一行/上一行



VB.net使用文件流请



当我按p它应该得到前一行而对于N它应该得到下一行。



提前谢谢

改善解决方案永久链接

发布于1秒前

praveenvinci437

i want to read next line / previous line in a text file by keys.xx events

VB.net using filestream pls

when i press p it should get previous line and for N it should get next line.

Thanks in advance
Improve solution Permalink
Posted 1 sec ago
praveenvinci437

推荐答案

没有阅读文本文件的上一行。读取文本文件几乎只是一个向前操作。



最简单的方法是将整个文件读入一个数组。文件中的每一行都是数组中的一个条目。然后,您只需使用您的键逐行浏览数组。
There is no "reading the previous line" of a text file. Reading the text file is pretty much a forward-only operation.

The easiest way to do it is to read the entire file into an array. Each line in the file will be one entry in the array. Then you simply navigate through the array line by line using your keys.


这篇关于通过keys.xx事件读取文本文件中的下一行/上一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆