Click or drag to resize

PathLocalToUnc Method (String)

[AlphaFS] Converts a local path to a network share path.

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
public static string LocalToUnc(
	string localPath


Type: SystemString
A local path, e.g.: "C:\Windows".

Return Value

Type: String
On successful conversion a UNC path is returned.

If the conversion fails, localPath is returned.

If localPath is an empty string or , is returned.

See Also