using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace FS_CLIENT { class FileCheck { List FileList = new List(); List Unhashed = new List(); static MemoryStream memory = new MemoryStream(); public void LoadFiles() { string line; StreamReader reader = new StreamReader(memory); while ((line = reader.ReadLine()) != null) { if (File.Exists(line)) { Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("{0} added to the list.", line); FileList.Add(Utility.GetHash(line)); Unhashed.Add(line); Console.ForegroundColor = ConsoleColor.Gray; } else { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("{0} could not be found!", line); FileList.Add("-"); Unhashed.Add(line); Console.ForegroundColor = ConsoleColor.Gray; } } } public string[] GetHashedFileArray() { return FileList.ToArray(); } public string[] GetUnhashedFileArray() { return Unhashed.ToArray(); } public void WriteToStream(string data) { byte[] buffer = Encoding.ASCII.GetBytes(data); memory.Write(buffer, 0, buffer.Length); memory.Flush(); memory.Seek(0, SeekOrigin.Begin); } public MemoryStream FileCheckList() { return memory; } } }