从流中读取 [英] Read from stream

查看:74
本文介绍了从流中读取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



您好,

我想知道如何以这种方式阅读文件:

从第X行到第Y行读取在从Y行到P行的其他迭代中以及

上。怎么实现呢?哪种方法怎么样?谢谢你!

***通过Developersdex发送 http://www.developersdex .com ***


Hello,
I would like to know how can I read a file by this way:
Read from line X to Y and in other iteration from line Y to P and on and
on. How to implement it? Which method and how? Thank u!
*** Sent via Developersdex http://www.developersdex.com ***

推荐答案

12月19日上午7:58,csharpula csharp< csharp ... @ yahoo。编写:
On Dec 19, 7:58 am, csharpula csharp <csharp...@yahoo.comwrote:

我想知道如何通过这种方式读取文件:

从第X行到第Y行读取从Y行到P再到on和

的迭代。怎么实现呢?哪种方法怎么样?感谢你!
I would like to know how can I read a file by this way:
Read from line X to Y and in other iteration from line Y to P and on and
on. How to implement it? Which method and how? Thank u!



目前尚不清楚你的意思 - 什么是X,Y和P?你能用真实世界的术语描述

这个问题吗?


Jon

It''s not clear what you mean - what are X, Y and P? Could you describe
the issue you''re trying to solve in real-world terms?

Jon

如果您正在谈论行,那么您可能需要一个

StreamReader,通过File.OpenText(路径) - 其中包含

等方法的ReadLine()。如果你只是向前阅读,那么这应该很简单 - 只需跟踪你所在的线路。为了方便起见,你可能会把它包起来,但很难说怎么样

没有更多关于你想要做什么的信息。 ..


Marc
If you are talking about "lines", then you probably want a
StreamReader, via File.OpenText(path) - which has methods such as
ReadLine(). If you are just reading forwards, then this should be
quite easy - just keep track of which line you are on. You could
probably wrap it up a bit for convenience, but it is hard to say "how"
without a bit more information on what you are trying to do...

Marc




我会尝试解释自己:我想读几个时间相同的文件

一直在更新。我想从开始阅读,直到

在A阶段结束,在阶段B从A结尾读到新结束

等等。

如何做?希望它更清楚。谢谢!

***通过开发人员指南 http://www.developersdex发送。 com ***

I will try to explain myself :I want to read couple of times same file
which is being updated all the time. I want to read from beggining till
end at phase A and in phaseB to read from the end of A till the new end
and so on.
How to do it? Hope it''s more clear. Thanks!
*** Sent via Developersdex http://www.developersdex.com ***


这篇关于从流中读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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