//取得工作目录下的文件
public static ArrayList ListFiles(string strFolderEntry)
{
ArrayList objFileList = new ArrayList();
ListFilesFormFolder(strFolderEntry, ref objFileList);
return objFileList;
}
private static void ListFilesFormFolder(string strFolderEntry, ref ArrayList objFileList)
{
foreach (string strFile in Directory.GetFiles(strFolderEntry))
{
if (!objFileList.Contains(strFile))
{
objFileList.Add(strFile);
}
}
foreach (string strFolder in Directory.GetDirectories(strFolderEntry))
{
ListFilesFormFolder(strFolder, ref objFileList);
}
}