Read each line in file and put each line into a string

…衆ロ難τιáo~ 提交于 2019-12-02 08:40:40

You may want to consider using the File.ReadAllLines() method which will store each line of your file into an array :

var lines = File.ReadAllLines(FileName);

You could then access each of your properties by their indices as needed :

string Date = lines[0];
string Time = lines[1];
string Phone = lines[2];
string JobNo = lines[3];
string Name = lines[4];
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!