When all files is bigger than 60 Mb ,it works very slowly.
int count1 = File.ReadLines(sharesList.Items.ToString()).Count();
//The sharesList contains all files
for (int m = 0; m < count1; m++)
foreach (String s in sharesList.Items)
string shar1 = File.ReadAllLines(s).Skip(m).Take(1).First();
if (shar1 != null && shar1 != "")
Instead of using ReadAllLines, write a method that calls ReadLine() in a for loop iterating up to m, then close the file and return that line.
This will save time because you'll only read the file up to the line that you need.
Without actually reading the file, there is no way to seek to the correct location based on a count of lines.