Saving Locally


Writing Data to a File


Available in .NET 4.0

System.Collections.Generic.List<string> myList; 
System.IO.File.WriteAllLines("C:\temp\SavedLists.txt", myList);

Prioir to .NET 4.0 you needed to use a StreamWriter




Reading Data from a File


System.Collections.Generic.List<string> myList; 
myList = System.IO.File.ReadAllLines("C:\temp\SavedLists.txt");




© 2021 Better Solutions Limited. All Rights Reserved. © 2021 Better Solutions Limited TopPrevNext