UtilFileAssocRegister Method
Registers or modifies a file extension in the current system.
Namespace: DevCase.Core.IO.FileSystemAssembly: 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""
)
Public Shared Sub Register (
scope As RegistryScope,
extensionName As String,
keyReferenceName As String,
Optional friendlyName As String = "",
Optional defaultIcon As String = "%WINDIR%\System32\shell32.dll",
Optional iconIndex As Integer = 0,
Optional executable As String = "%WINDIR%\System32\OpenWith.exe",
Optional arguments As String = ""%1""
)
Dim scope As RegistryScope
Dim extensionName As String
Dim keyReferenceName As String
Dim friendlyName As String
Dim defaultIcon As String
Dim iconIndex As Integer
Dim executable As String
Dim arguments As String
UtilFileAssoc.Register(scope, extensionName,
keyReferenceName, friendlyName,
defaultIcon, iconIndex, executable,
arguments)
public:
static void Register(
RegistryScope scope,
String^ extensionName,
String^ keyReferenceName,
String^ friendlyName = L"",
String^ defaultIcon = L"%WINDIR%\System32\shell32.dll",
int iconIndex = 0,
String^ executable = L"%WINDIR%\System32\OpenWith.exe",
String^ arguments = L""%1""
)
static member Register :
scope : RegistryScope *
extensionName : string *
keyReferenceName : string *
?friendlyName : string *
?defaultIcon : string *
?iconIndex : int *
?executable : string *
?arguments : string
(* Defaults:
let _friendlyName = defaultArg friendlyName ""
let _defaultIcon = defaultArg defaultIcon "%WINDIR%\System32\shell32.dll"
let _iconIndex = defaultArg iconIndex 0
let _executable = defaultArg executable "%WINDIR%\System32\OpenWith.exe"
let _arguments = defaultArg arguments ""%1""
*)
-> unit
No code example is currently available or this language may not be supported.
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.
This is a code example.
No code example is currently available or this language may not be supported.
FileAssoc.Register(scope:=RegistryScope.CurrentUser,
extensionName:=".elek",
keyReferenceName:="ElektroFile",
friendlyName:="Elektro File",
defaultIcon:="%WinDir%\System32\Shell32.ico",
iconIndex:=0,
executable:="%WinDir%\notepad.exe",
arguments:="""%1""")
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
|
ArgumentNullException
|
extensionName
|
|
InvalidEnumArgumentException
|
scope
|