📅  最后修改于: 2022-03-11 14:48:38.285000             🧑  作者: Mango
DirectoryInfo dir = new DirectoryInfo(path);
FileInfo[] files = dir.GetFiles("*.txt");
foreach (FileInfo file in files)
{
string noExtension = Path.GetFileNameWithoutExtension(file.Name);
}