Like this?
string path = @"";
DirectoryInfo dir = new DirectoryInfo(path);
var files = dir.GetFiles("*.txt");
if (files.Length >= 2)
{
}
More Related Contents:
- When is it acceptable to call GC.Collect?
- Get output parameter value in ADO.NET
- Enum type constraints in C# [duplicate]
- Is a memory leak created if a MemoryStream in .NET is not closed?
- Why are C# structs immutable?
- process.WaitForExit() asynchronously
- Enter “&” symbol into a text Label in Windows Forms?
- Relocating app.config file to a custom path
- String escape into XML
- Disable JavaScript error in WebBrowser control
- Disposing WPF User Controls
- JToken: Get raw/original JSON value
- GUI and windows service communication
- Metadata were not loaded using MetadataType
- GC.Collect()
- Writing string at the same position using Console.Write in C# 2.0
- Ghost-borders (‘ringing’) when resizing in GDI+
- C# Windows Form .Net and DOS Console
- .NET Core and System.Drawing
- .Net regex: what is the word character \w?
- How to set read permission on the private key file of X.509 certificate from .NET
- Does String.GetHashCode consider the full string or only part of it?
- How would I sort a list of files by name to match how Windows Explorer displays them?
- Why doesn’t C# support implied generic types on class constructors?
- Reflection.Emit vs CodeDOM
- Why choose a static class over a singleton implementation?
- Upload CSV file to SQL server
- Is TLS 1.1 and TLS 1.2 enabled by default for .NET 4.5 and .NET 4.5.1?
- Remove top and bottom padding from Text drawn on an Image
- Validating user input / Give .NET controls status OK or NOK