user584018
user584018

Reputation: 11304

C#: get all files which don't have any extension

I am able to get files from a directory with having certain extension (example .txt),

var x = Directory.GetFiles(@"C:\Test\", "*.txt");

But, how to get file/s which don't have any extension (XYZ below image),

enter image description here

Upvotes: 0

Views: 72

Answers (2)

Flat Eric
Flat Eric

Reputation: 8111

Directory.GetFiles(@"C:\test\", "*.");

Upvotes: 2

JohnyL
JohnyL

Reputation: 7122

var noExtFiles = Directory.EnumerateFiles(@"c:\Temp\", "*.");

Upvotes: 1

Related Questions