static void AvailibleMemory() { string path7 = @"../../Physical Memory.txt"; string path8 = @"../../Virtual Memory.txt"; Charge el = Charge.B; StreamWriter writer = new StreamWriter(new FileStream(path7, FileMode.Create)); StreamWriter writer1 = new StreamWriter(new FileStream(path8, FileMode.Create)); writer.WriteLine(PCStatus.AvailablePhysicalMemory(3) + " " + (el + 3).ToString()); writer1.WriteLine(PCStatus.AvailibleVirtualMemory(3) + " " + (el + 3).ToString()); writer.Close(); writer1.Close(); Console.WriteLine("AvailibleMemory() done at {0} sec", Math.Round(sec, 1)); }
static void SerializedAvailibleMemory() { string path7 = @"../../Physical Memory.txt"; string path8 = @"../../Virtual Memory.txt"; Charge el = Charge.B; BinaryFormatter formatter = new BinaryFormatter(); using (FileStream s1 = new FileStream(path7, FileMode.Create)) { formatter.Serialize(s1, PCStatus.AvailablePhysicalMemory(3) + " " + (el + 3).ToString()); } using (FileStream s2 = new FileStream(path8, FileMode.Create)) { formatter.Serialize(s2, PCStatus.AvailibleVirtualMemory(3) + " " + (el + 3).ToString()); } Console.WriteLine("SerializedAvailibleMemory() done at {0} sec", Math.Round(sec, 1)); }