Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static List<Countries> openFile(string fileName)
- {
- string line = null;
- List<string> liste = new List<string>();
- List<Countries> countries = new List<Countries>();
- using (StreamReader reader = new StreamReader(fileName)) //fileName = "capitals.txt")
- {
- line = reader.ReadLine();
- while (line != null)
- {
- liste.Add(line);
- line = reader.ReadLine();
- }
- }
- foreach (string ttt in countries)
- {
- string[] test = ttt.Split('t');
- countries.Add(new Countries() { nomPays = test[0], Capitale = test[1] });
- }
- return countries;
- }
- //get local folder
- StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
- var dataFolder = await local.GetFolderAsync("dataFolder");
- var file = await local.OpenStreamForReadAsync("Capitals.txt");
- var uri = new System.Uri("ms-appx:///Assets/Capitals.txt");
- var file = Windows.Storage.StorageFile.GetFileFromApplicationUriAsync
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement