using System;
using System.Windows.Forms;
using System.IO;
public class TagPropertyExample : System.Windows.Forms.Form {
ListView listView = new ListView();
public TagPropertyExample () {
listView.Left = 10;
listView.Top = 10;
listView.Size = new System.Drawing.Size(292, 273);
DirectoryInfo directory = new DirectoryInfo("C:\\");
FileInfo[] files = directory.GetFiles();
foreach (FileInfo file in files) {
ListViewItem item = listView.Items.Add(file.Name);
item.ImageIndex = 0;
item.Tag = file;
}
this.Controls.Add(listView);
}
public static void Main(){
Application.Run(new TagPropertyExample());
}
}
|