跳进文件行C#文件

2023-09-04 10:34:06 作者:素颜妆

我怎么能跳进一些线在我的文件中,如行300在C:\的text.txt

解决方案

 暗淡arrText()作为字符串
昏暗lineThreeHundred作为字符串

arrText = File.ReadAllLines(C:\ test.txt的)

lineThreeHundred = arrText(299)
 

编辑:C#版本

 的String [] arrText;
串lineThreeHundred;

arrText = File.ReadAllLines(C:\ test.txt的);
lineThreeHundred = arrText [299];
 

C 各个版本中的新增特性详解

how can i jump into some line in my file, e.g line 300 in c:\text.txt?

解决方案

Dim arrText() As String 
Dim lineThreeHundred As String

arrText = File.ReadAllLines("c:\test.txt") 

lineThreeHundred = arrText(299) 

Edit: C# Version

string[] arrText;
string lineThreeHundred;

arrText = File.ReadAllLines("c:\test.txt");
lineThreeHundred = arrText[299];