PathLocalToUnc Method (String, PathFormat, GetFullPathOptions) |
[AlphaFS] Converts a local path to a network share path, optionally returning it as a long path format and the ability to add or remove a trailing backslash.
A Local path, e.g.: "C:\Windows" or "C:\Windows\" will be returned as: "\\localhost\C$\Windows".
If a logical drive points to a network share path (mapped drive), the share path will be returned without a trailing DirectorySeparator character.
Namespace:
Alphaleonis.Win32.Filesystem
Assembly:
AlphaFS (in AlphaFS.dll) Version: 2.2
Syntax public static string LocalToUnc(
string localPath,
PathFormat pathFormat,
GetFullPathOptions fullPathOptions
)
Public Shared Function LocalToUnc (
localPath As String,
pathFormat As PathFormat,
fullPathOptions As GetFullPathOptions
) As String
public:
static String^ LocalToUnc(
String^ localPath,
PathFormat pathFormat,
GetFullPathOptions fullPathOptions
)
static member LocalToUnc :
localPath : string *
pathFormat : PathFormat *
fullPathOptions : GetFullPathOptions -> string
Parameters
- localPath
- Type: SystemString
A local path, e.g.: "C:\Windows". - pathFormat
- Type: Alphaleonis.Win32.FilesystemPathFormat
Indicates the format of the path parameter. - fullPathOptions
- Type: Alphaleonis.Win32.FilesystemGetFullPathOptions
Options for controlling the full path retrieval.
Return Value
Type:
StringOn successful conversion a UNC path is returned.
If the conversion fails, localPath is returned.
If localPath is an empty string or , is returned.
Exceptions See Also