Table of Contents

Method DeleteFiles

Namespace
Alternet.Common
Assembly
Alternet.Common.v10.dll

DeleteFiles(string?, string)

Deletes files in the specified folder that match the given search pattern.

public static bool DeleteFiles(string? pathToFolder, string searchPattern)

Parameters

pathToFolder string

The path to the folder where files will be deleted.

searchPattern string

The search pattern to match files (e.g., "*.txt").

Returns

bool

true if the operation succeeds or the folder does not exist; false if an exception occurs during the operation.