|
|
@@ -107,6 +107,20 @@ namespace Azylee.Core.IOUtils.TxtUtils
|
|
|
}
|
|
|
catch (Exception e) { }
|
|
|
}
|
|
|
+ public static void ReadLine(string file,Encoding encoding, Action<int, string> action)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ using (StreamReader sr = new StreamReader(file, encoding))
|
|
|
+ {
|
|
|
+ string line;
|
|
|
+ int number = 1;
|
|
|
+ while ((line = sr.ReadLine()) != null)
|
|
|
+ action.Invoke(number++, line);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception e) { }
|
|
|
+ }
|
|
|
public static long CountLine(string file, string[] filter)
|
|
|
{
|
|
|
long count = 0;
|