private static void SaveConnection(SavedConnection c) { try { StreamWriter sw = new StreamWriter("connections.data"); sw.WriteLine(c.username + "@" + c.hostname); sw.Close(); } catch (Exception e) { } }
private static List <SavedConnection> LoadConnections() { List <SavedConnection> con = new List <SavedConnection>(); try { StreamReader sr = new StreamReader("connections.data"); string l; while ((l = sr.ReadLine()) != null) { string[] split = l.Split("@"); SavedConnection sc = new SavedConnection(split[1], split[0]); con.Add(sc); } sr.Close(); } catch (Exception e) { } return(con); }