Directory.CreateSymbolicLink(String, String) 方法

定義

建立由識別的 path 目錄符號連結,指向 pathToTarget

public:
 static System::IO::FileSystemInfo ^ CreateSymbolicLink(System::String ^ path, System::String ^ pathToTarget);
public static System.IO.FileSystemInfo CreateSymbolicLink (string path, string pathToTarget);
static member CreateSymbolicLink : string * string -> System.IO.FileSystemInfo
Public Shared Function CreateSymbolicLink (path As String, pathToTarget As String) As FileSystemInfo

參數

path
String

應該建立符號連結的路徑。

pathToTarget
String

符號鏈接的目標目錄。

傳回

DirectoryInfo包裝新建立之目錄符號連結的 實例。

例外狀況

pathpathToTargetnull

pathpathToTarget 是空的。

-或-

pathpathToTarget 包含無效的路徑字元。

檔案或目錄已存在於 的位置 path

-或-

發生 I/O 錯誤。

適用於

另請參閱