UtilFileAssocRegister Method

Registers or modifies a file extension in the current system.

Definition

Namespace: DevCase.Core.IO.FileSystem
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static void Register(
	RegistryScope scope,
	string extensionName,
	string keyReferenceName,
	string friendlyName = "",
	string defaultIcon = "%WINDIR%\System32\shell32.dll",
	int iconIndex = 0,
	string executable = "%WINDIR%\System32\OpenWith.exe",
	string arguments = ""%1""
)

Parameters

scope  RegistryScope
The registry scope that will owns the file association.
extensionName  String
The extension name (eg: .txt).
keyReferenceName  String
The name of the registry key to reference.
friendlyName  String  (Optional)
The friendly name for this file extension (visible in Windows Esplorer).
defaultIcon  String  (Optional)
The icon filepath.
iconIndex  Int32  (Optional)
The index image of the icon resource.
executable  String  (Optional)
The executable path that will open the file.
arguments  String  (Optional)
The executable arguments, normally this value is set as '"%1"' to take the filepath as the only one argument, or '"%1" %*' to take the filepath as first argument and additional arguments.

Example

This is a code example.
C#
No code example is currently available or this language may not be supported.

Exceptions

ArgumentNullException extensionName
InvalidEnumArgumentException scope

See Also