You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.3 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 Übungen_LF6_WinFormanwendung
{
public partial class DatenHandlingÜbung : Form
{
private String[] strWerte;
private int[] intWerte;
public DatenHandlingÜbung()
{
InitializeComponent();
}
private void button_ende_Click(object sender, EventArgs e)
{
this.Close();
}
private void button_dateiÖffnen_Click(object sender, EventArgs e)
{
openFileDialog1.Filter = "CSV-Datei (*.csv)|*.csv|Textdatei (*.txt)|*.txt|Alle Dateien(*.*)|*.*";
if(openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
textBoxFileName.Text = openFileDialog1.FileName;
strWerte = File.ReadAllLines(openFileDialog1.FileName);
}
}
private void buttonAnzeige_Click(object sender, EventArgs e)
{
foreach (string zeile in strWerte)
{
listBoxDaten.Items.Add(zeile);
}
}
}
}