如何使用c#计算记事本中的no.of行数 [英] how to calculate the no.of lines in notepad using c#

查看:75
本文介绍了如何使用c#计算记事本中的no.of行数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我拿了一个记事本......并且一个接一个地垂直放置10,000个数字......

现在我将如何使用c#获取记事本中的行数(行数)。 plz提前感谢一些代码

suppose i take a note pad..and place 10,000 numbers vertically one after the other...
now how will i get the number of lines(rows) in the notepad using c#..plz give some code thanks in advance

推荐答案

hi ,,





试试这个代码,

u可以在记事本中获得no.of行。





,


try this code,
u can get no.of lines in notepad.


string[] lines = System.IO.File.ReadAllLines("D:\\12.txt");
MessageBox.Show(lines.Length.ToString());







问候,

Prakash.T




regards,
Prakash.T


这篇关于如何使用c#计算记事本中的no.of行数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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