且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在不指定文件扩展名的情况下检查文件是否存在

更新时间:2021-09-09 23:21:33

请参阅: Directory.GetFiles [ ^ ]

它给出的示例的修改版本:

See here: Directory.GetFiles[^]
A modified version of the example it gives:
array<String^>^dirs = Directory::GetFiles( "D:\\Temp\\", "myfile.*" );
Console::WriteLine( "Found: {0}", dirs->Length );

数组将包含每个文件的完整路径,包括扩展名。

The array will contain the full path to each file, including the extension.