编写了一个程序,在listview控件中显示,现在想将顺序的那一列进行排序,并且按照排序的顺序编号:1,2,3,4。。。。。。请问应该怎么写!现在按钮中的代码如下
string filename;
DirectoryInfo TheFolder = new DirectoryInfo(textBox4.Text);
foreach (FileInfo file in TheFolder.GetFiles()) {
filename = file.Name.Substring(0, file.Name.LastIndexOf(“.”));
ListViewItem listItem = new ListViewItem();
listItem.Checked = true;
listItem.Text = filename;
listItem.SubItems.Add(filename.Substring(filename.Length – 6, 6));
listView1.Items.Add(listItem);
应该怎么填写,说的具体一点, 谢谢了!
string filename;
DirectoryInfo TheFolder = new DirectoryInfo(textBox4.Text);
foreach (FileInfo file in TheFolder.GetFiles()) {
filename = file.Name.Substring(0, file.Name.LastIndexOf(“.”));
ListViewItem listItem = new ListViewItem();
listItem.Checked = true;
listItem.Text = filename;
listItem.SubItems.Add(filename.Substring(filename.Length – 6, 6));
listView1.Items.Add(listItem);
应该怎么填写,说的具体一点, 谢谢了!