public SimpleTree LoadBIN(string path) { SimpleTree st = new SimpleTree(); double result; using (BinaryReader br = new BinaryReader(File.Open(path, FileMode.Open))) { int numberOfByte = br.ReadInt32(); byte[] array = br.ReadBytes(numberOfByte); string s = ByteArrayToString(array); if (!(double.TryParse(s, out result))) { throw new Exception("Diese Datei besitzt leider nicht das richtige Format!"); } st.Add(double.Parse(s)); } return(st); }
public SimpleTree LoadCSV(string path) { StreamReader Reader = new StreamReader(path); double result; string line = Reader.ReadLine(); SimpleTree AllData = new SimpleTree(); while (line != null) { if (!(double.TryParse(line, out result))) { throw new Exception("Diese Datei besitzt leider nicht das richtige Format!"); } AllData.Add(double.Parse(line)); line = Reader.ReadLine(); } return(AllData); }