Udostępnij za pośrednictwem


RegistrationAttribute.RegistrationContext.EscapePath(String) Method

Definition

Reformats a string as needed by the registration tool.

public:
 abstract System::String ^ EscapePath(System::String ^ str);
public:
 abstract Platform::String ^ EscapePath(Platform::String ^ str);
 abstract std::wstring EscapePath(std::wstring const & str);
public abstract string EscapePath (string str);
abstract member EscapePath : string -> string
Public MustOverride Function EscapePath (str As String) As String

Parameters

str
String

The path string to reformat.

Returns

The reformatted path string.

Remarks

Many registration programs require strings to be in a special format in order to work. For instance, the files used by regedit.exe (.reg / .vbr) use back slash characters ("\") to indicate special characters using character escapes. In order for regedit.exe to interpret a file path correctly, each back slash must be repeated to form the correct character escape ("\\"). For more information on character escapes, see Character Escapes. In CreatePkgDef, EscapePath formats a string containing a file path by replacing single back slash characters ("\") with double back slash characters ("\\"). However, other classes that implement EscapePath can perform whatever string conversion is required.

Applies to