VB.NET怎么读取某个文件夹下面的所有excel文件
如题
[解决办法]
Dim sFilePath As String '路径
Dim sSearchPattern As String '扩展名
Dim oDirectoryInfo As IO.DirectoryInfo
Dim oFileInfoCollection As IO.FileInfo()
oDirectoryInfo = New IO.DirectoryInfo(sFilePath)
oFileInfoCollection = oDirectoryInfo.GetFiles(sSearchPattern)
[解决办法]
string[] ZipCheckFile = Directory.GetFiles(@"文件夹\", "*.xls");
for (int ZipFileCount = 0; ZipFileCount <= ZipCheckFile.Length - 1; ZipFileCount++)
{
messagebox.show(ZipCheckFile[ZipFileCount]);
}