Läs på engelska Redigera

Dela via


Directory.CreateSymbolicLink(String, String) Method

Definition

Creates a directory symbolic link identified by path that points to pathToTarget.

C#
public static System.IO.FileSystemInfo CreateSymbolicLink(string path, string pathToTarget);

Parameters

path
String

The path where the symbolic link should be created.

pathToTarget
String

The target directory of the symbolic link.

Returns

A DirectoryInfo instance that wraps the newly created directory symbolic link.

Exceptions

path or pathToTarget is null.

path or pathToTarget is empty.

-or-

path or pathToTarget contains invalid path characters.

A file or directory already exists in the location of path.

-or-

An I/O error occurred.

Applies to

Produkt Versioner
.NET 6, 7, 8, 9, 10

See also