File.CreateSymbolicLink(String, String) 方法

定義

建立指向的pathpathToTarget檔案符號連結。

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

符號連結指向的目標路徑。

傳回

FileInfo包裝新建立檔案符號連結的 實例。

例外狀況

pathpathToTargetnull

pathpathToTarget 是空的。

-或-

pathpathToTarget 包含 null 字元。

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

-或-

發生 I/O 錯誤。

適用於

另請參閱