Ahoj, proč vždy pole pom má jen velikost 1??????
namespace knihovna
{
public partial class Form1 : Form
{
int i = 0;
string soubor = "knihy.txt";
List<string> _items = new List<string>();
public Form1()
{
InitializeComponent();
_items.Add("Autor");
_items.Add("Dílo");
_items.Add("ID");
lb_hledani.DataSource = _items;
FileStream osoubor = File.Open (soubor, FileMode.Open);
StreamReader cteni = new StreamReader(osoubor, Encoding.Default);
StreamReader cteni1 = cteni;
var file = cteni1.ReadToEnd();
var lines = file.Split(new char[] { '\n' }); // big array
var count = lines.Count();
string[] autor= new string[count];
string[] dl = new string[count];
string [] pom; //= new string[count];
string[] id = new string[count];
while (i<count)
{
string str = lines[i];
pom = str.Split (new string[] { "," }, StringSplitOptions.None);
autor[i] = pom[0];
dl[i] = pom[1];
id[i] = pom[3];
i++;
tbx_ukaz.Text = "ahoj";
}
MessageBox.Show("ahoj");
}