77 lines
1.8 KiB
C#
77 lines
1.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using System.IO;
|
|
|
|
namespace WindowsFormsApp1
|
|
{
|
|
public partial class Form1 : Form
|
|
{
|
|
public Form1()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void label1_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
private void Form1_Load(object sender, EventArgs e)
|
|
{
|
|
FileStream fileStream = new FileStream("oscar.csv", FileMode.Open, FileAccess.Read);
|
|
StreamReader streamReader = new StreamReader(fileStream);
|
|
|
|
string line = streamReader.ReadLine();
|
|
line = streamReader.ReadLine();
|
|
|
|
while (line != null)
|
|
{
|
|
string[] content = line.Split(';');
|
|
|
|
Film film = new Film(content[0], content[1], Convert.ToInt32(content[2]), Convert.ToInt32(content[3]), Convert.ToInt32(content[4]));
|
|
|
|
Data.films.Add(film);
|
|
|
|
|
|
}
|
|
|
|
streamReader.Close();
|
|
fileStream.Close();
|
|
}
|
|
|
|
|
|
}
|
|
|
|
public static class Data
|
|
{
|
|
public static List<Film> films = new List<Film>();
|
|
public static List<string> filmnames = new List<string>();
|
|
|
|
}
|
|
|
|
public class Film
|
|
{
|
|
public string azonosito;
|
|
public string cim;
|
|
public int ev;
|
|
public int dij;
|
|
public int jelolt;
|
|
|
|
public Film(string azonosito, string cim, int ev, int dij, int jelolt)
|
|
{
|
|
this.azonosito = azonosito;
|
|
this.cim = cim;
|
|
this.ev = ev;
|
|
this.dij = dij;
|
|
this.jelolt = jelolt;
|
|
}
|
|
}
|
|
}
|