Table of Contents

Method GenerateUniqueFilenameInDownloads

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

GenerateUniqueFilenameInDownloads(string)

Generates a unique filename in the user's Downloads folder based on the specified filename template.

public static string GenerateUniqueFilenameInDownloads(string fileNameTemplate)

Parameters

fileNameTemplate string

The template for the filename, which may include placeholders or a base name. For example, "file_{0}.txt" can be used to generate filenames like "file_1.txt", "file_2.txt", etc.

Returns

string

A unique filename within the Downloads folder that does not conflict with existing files.

Remarks

This method ensures that the generated filename is unique by checking for conflicts in the Downloads folder. The filename template should be designed to allow for uniqueness, such as including placeholders for numbering.