Hi see code below, i like to know this is write way to do that. code is working fine, but i feel something is not right.
My purpose is this code is - in the text file has 3 lines, i need to access this 3 file one by one.and need to put 3 variables.
see below code
string line = string.Empty;
Class ClientFiles{public List<string []> ClientSaveFileDetails(){List<string []> clientFileList = new List<string []>();SaveFilename=@"C:\test.txt"; using (StreamReader clientRead = new StreamReader(SaveFilename)) { while ((line = clientRead.ReadLine()) != null) { clientFileList.Add(new string[] { line }); } } return clientFileList;}}I have already called the above class using below codeClientFiles cl=new ClientFiles();List<string[]> clSitename = cl.ClientSaveFileDetails();string rowdetail1=clSitename[0][0];//1st line of the filestring rowdetail2=clSitename[1][0];//2st line of the filestring rowdetail3=clSitename[2][0];//3st line of the fileConsole.writeline(rowdetail1);Console.writeline(rowdetail2);Console.writeline(rowdetail3);