All pastes #367585 Raw Edit

Something

public text v1 · immutable
#367585 ·published 2007-02-22 13:22 UTC
rendered paste body
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;


namespace WindowsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            listView1.Items.Clear();
            FolderBrowserDialog Folder = new FolderBrowserDialog();
            Folder.ShowDialog();
            string Search = "*";
            if (textBox1.Text.Length > 0)
                Search = textBox1.Text;
            System.IO.DirectoryInfo Mappe = new System.IO.DirectoryInfo(Folder.SelectedPath.ToString());
            foreach (System.IO.FileInfo Fil in Mappe.GetFiles(Search))
            {
                listView1.Items.Add(Fil.Name);
                listView1.Items[listView1.Items.Count-1].SubItems.Add(Fil.Length.ToString());
            }
        }
    }
}