Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Windows.Forms;
- using System.Collections.Generic;
- using System.IO;
- namespace FinalAssm
- {
- static class cls_Data
- {
- static List<Planets> PlanetsList;
- static void mtd_InsertData()
- {
- const string FilePath = @"C:\Users\sergey\Desktop\Data\";
- PlanetsList = new List<Planets>();
- FileStream PlanetsStream = File.OpenRead(FilePath + "Planets.csv");
- var PlanetsReader = new StreamReader(PlanetsStream);
- while (!PlanetsReader.EndOfStream)
- {
- string line = PlanetsReader.ReadLine();
- string[] field = line.Split(',');
- PlanetsList.Add(new Planets(field[0], field[1]));
- }
- PlanetsReader.Close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement