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 Vlimport { public partial class mainForm : Form { List operations = new List(); public mainForm() { InitializeComponent(); openFileDialog1.Filter = "Text files(*.xml)|*.xml|All files(*.*)|*.*"; } private void SelectButton_Click(object sender, EventArgs e) { //ItemList.Items.Clear(); if (openFileDialog1.ShowDialog() == DialogResult.Cancel) return; // получаем выбранный файл string filename = openFileDialog1.FileName; // читаем файл в строку string fileText = System.IO.File.ReadAllText(filename); FilePathBox.Text = filename.ToString(); Transporter tr = new Transporter(); tr.CollectItems(filename, ItemList); } } }