Table of Contents

Method GetVersionInfo

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

GetVersionInfo(string)

Retrieves version information from the specified file as a dictionary of key-value pairs.

public static IDictionary<string, string> GetVersionInfo(string filePath)

Parameters

filePath string

The path to the file from which to extract version information. Must not be null or empty.

Returns

IDictionary<string, string>

A dictionary containing version information fields and their values. The dictionary is empty if the file does not exist or if version information cannot be retrieved.

Remarks

The returned dictionary may include fields such as "FileVersion", "ProductVersion", "CompanyName", and others, depending on the information available in the file's version resources. If the file does not contain version information or an error occurs during retrieval, the dictionary will be empty. This method uses both managed and native Windows APIs to extract as much version information as possible.

Exceptions

ArgumentNullException

Thrown if filePath is null or empty.

PlatformNotSupportedException

Thrown if the current operating system is not Windows.