private void GetFileList(string strCurDir)
{
string FileName, FileExt;
///文件大小
long FileSize;
///最後修改時間;
DateTime FileModify;
///初始化時,默認為當前頁面所在的目錄
strCurDir = Server.MapPath(strCurDir);
// lblCurDir.Text = strCurDir;
// /txtCurDir.Text = strCurDir;
if (Directory.Exists(Path.GetDirectoryName(strCurDir)))
{
//Directory.CreateDirectory(Path.GetDirectoryName(filePath));
FileInfo fi;
DirectoryInfo dir;
TableCell td;
TableRow tr;
tr = new TableRow();
///動態添加單元格內容
td = new TableCell();
td.Controls.Add(new LiteralControl("文件名"));
tr.Cells.Add(td);
td = new TableCell();
td.Controls.Add(new LiteralControl("文件類型"));
tr.Cells.Add(td);
td = new TableCell();
td.Controls.Add(new LiteralControl("文件大小"));
tr.Cells.Add(td);
td = new TableCell();
td.Controls.Add(new LiteralControl("最後修改時間"));
tr.Cells.Add(td);
tableDirInfo.Rows.Add(tr);
///針對當前目錄建立目錄引用對象
DirectoryInfo dirInfo = new DirectoryInfo(strCurDir);
///循環判斷當前目錄下的文件和目錄
foreach (FileSystemInfo fsi in dirInfo.GetFileSystemInfos())
{
FileName = "";
FileExt = "";
FileSize = 0;
///如果是文件
if (fsi is FileInfo)
{
fi = (FileInfo)fsi;
///取得文件名
FileName = fi.Name;
///取得文件的擴展名
FileExt = fi.Extension;
///取得文件的大小
FileSize = fi.Length;
///取得文件的最後修改時間
FileModify = fi.LastWriteTime;
//string files = fid.Text + "/" + id.Text + "/" + FileName;
//string thunb = "thumb/" + FileName;
//string opath = Server.MapPath("upfile/" + dir.Name + "/" + FileName);
//string tpath = Server.MapPath("upfile/thumb/" + FileName);
//ThumbImage.MakeThumbnail(opath, tpath, 142, 100, "D&qu