PathLocalToUnc Method (String, Boolean, Boolean, Boolean) |
[AlphaFS] Converts a local path to a network share path.
A Local path, e.g.: "C:\Windows" will be returned as: "\\localhostname\C$\Windows"
If a logical drive points to a network share path, the share path will be returned.
Namespace: Alphaleonis.Win32.FilesystemAssembly: AlphaFS (in AlphaFS.dll) Version: 2.0
Syntax public static string LocalToUnc(
string localPath,
bool asLongPath,
bool addTrailingDirectorySeparator,
bool removeTrailingDirectorySeparator
)
Public Shared Function LocalToUnc (
localPath As String,
asLongPath As Boolean,
addTrailingDirectorySeparator As Boolean,
removeTrailingDirectorySeparator As Boolean
) As String
public:
static String^ LocalToUnc(
String^ localPath,
bool asLongPath,
bool addTrailingDirectorySeparator,
bool removeTrailingDirectorySeparator
)
static member LocalToUnc :
localPath : string *
asLongPath : bool *
addTrailingDirectorySeparator : bool *
removeTrailingDirectorySeparator : bool -> string
Parameters
- localPath
- Type: SystemString
A local path, e.g.: "C:\Windows". - asLongPath
- Type: SystemBoolean
returns the path in long path (Unicode) format, when returns the path as a regular path. - addTrailingDirectorySeparator
- Type: SystemBoolean
adds a trailing DirectorySeparatorChar character to localPath, when absent. - removeTrailingDirectorySeparator
- Type: SystemBoolean
removes the trailing DirectorySeparatorChar character from localPath, when present.
Return Value
Type:
StringReturns a UNC path in long path format or
when
localPath is an empty string or
.
Exceptions See Also