在下面的“文件管理器”的程序代码中 方法FillFileView(string FullName) 写在什么地方???
using System;using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using
namespace FileManager
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
try
{
this.txtCurpath.Text = "My Computer";
this.FileView1.Clear();
this.FileView1.View = View.Details;
this.FileView1.Columns.Add("本地磁盘", Width / 3, HorizontalAlignment.Left);
string[] Drv = Directory.GetLogicalDrives();
int DrvCnt = Drv.Length;
for (int i = 0; i < DrvCnt; i++)
{
ListViewItem lvi = new ListViewItem();
this.FileView1.Items.Add(lvi);
lvi.Text = "驱动器" + Drv[i];
lvi.ImageIndex = 2;
lvi.Tag = Drv[i];}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);}}
private void Form1_Load(object sender, EventArgs e)
{
}
private void label1_Click(object sender, EventArgs e)
{
}
private void FileView1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void btnUp_Click(object sender, EventArgs e)
{
}
private void menuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
}
}}
其中 FillFileView(string FullName) 方法是以当前目录的全路径为输入参数,显示当前目录下的所有文件和文件夹,并把它们填充到ListView中
但是我不知道写在程序的什么地方 ,试了好几遍都出错。
求 高手们给看看 谢谢了啊