using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.OleDb;
using System.IO;
using System.Collections;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string SourceExcelPath = @"E:\C# Projects\ConsoleApplication1\";
DirectoryInfo mydir = new DirectoryInfo(SourceExcelPath);
if (mydir.GetFiles().Length <= 0)
{
Console.WriteLine("文件夹里面没有文件");
}
else
{
Console.WriteLine("文件夹里面有文件");
}
ArrayList list = new ArrayList();
foreach (FileSystemInfo fsi in mydir.GetFileSystemInfos())
{
if (fsi is FileInfo)//
{
FileInfo fi=(FileInfo)fsi;
if(fi.Extension.ToUpper()==
C#读取某个目录下的所有excel文件名
最新推荐文章于 2023-09-26 11:13:33 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)