read the second line from the text
c#, windows-8
Solution
var desiredText = File.ReadLines("C:\myfile.txt").ElementAt(1);
File.ReadLines() returns an `IEnumerable<String>` of the lines in a file. The index of the second line is 1. See this.
Problem
how do i read the second line of text in visual studio 2012 c# ``` the txt file user123 **12345** asdfd ``` i want to get the second line in one button1_click and show it to textblock2 i did try learn from here How do I read a specified line in a text file? and here How to skip first line and start reading file from second line in C# but no one of these works because theres difference i couldnt apply in my code any help? ================================================================================= sorry to confusing you all actually im really lacking experience in programming and i hardly know how to use it right now im using vs2012 in windows8 , is that mean i was coding in winrt? btw , i appreciate all your help and successfully applying answer to my code this is the actual code ``` var file = await ApplicationData.Current.LocalFolder.GetFileAsync(tb1.Text+".txt"); var line = await FileIO.ReadLinesAsync(file); if (tb2.Text == line[2]) { tb3.Text = (line[1]); } ```