Bellow is the code, it's so simple that I'm lazy to explain, enjoy:
DirectoryInfo dInfo = new DirectoryInfo(args[0]);
FileInfo[] Files = dInfo.GetFiles("*.php");
int i = 0;
foreach (FileInfo fInfo in Files)
{
string[] temp = File.ReadAllLines(fInfo.FullName);
i += temp.Length;
}
Console.WriteLine("Total Lines: " + i);
Console.ReadLine();
It's dirty but it works, if you have a better solution, please comment, I'll be pleased to learn a better way to do this.
2 comentários:
#!/bin/bash
wc -l *.php
Not sure if it's better, but sure as hell it's simpler :)
Well, sadly windows doesn't have bash script, maybe someone could hack a batch script to do the same...
Postar um comentário