Sprint 1
Her er mit oplæg til en struktur på Sprint 1. Du må gerne vælge en anden hvis du har lyst
class Program1 { static StreamWriter outFile; static StreamReader inFile; static void analyze(List
lines) { if (lines.Count < 2) return; String protocol = lines[1].Substring(67, 9); if (protocol.Trim().ToUpper() == "DNS") { //Tilføj din kode her } } //static void Main(string[] args) static void Main(string[] args) { inFile = new StreamReader("logfile.txt"); outFile = new StreamWriter("outLogs.txt"); String line; List
lines = new List
(); while (!inFile.EndOfStream) { line = inFile.ReadLine(); //Hvis line starter med No. er det en ny pakke, så skal vi først analysere den gamle if (line.StartsWith("No.") || inFile.EndOfStream) { analyze(lines); lines = new List
(); } lines.Add(line); } inFile.Close(); outFile.Close(); } }