Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog();
- public Form1()
- {
- InitializeComponent();
- }
- string[] slupyPath;
- private void button1_Click(object sender, EventArgs e)
- {
- DialogResult result = folderBrowserDialog.ShowDialog();
- if (result == DialogResult.OK)
- {
- string folderName = folderBrowserDialog.SelectedPath;
- string[] slupy = Directory.GetDirectories(folderName);
- slupyPath = slupy.Select(y => Path.GetFileName(y)).ToArray();
- ListViewItem[] x = new ListViewItem[slupyPath.Length];
- for(int i = 0; i < slupyPath.Length; i++)
- {
- x[i] = new ListViewItem(slupyPath[i]);
- }
- listViewPoles.Items.AddRange(x);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement