File.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

符号链接指向的目标的路径。

返回

FileSystemInfo

一个 FileInfo 实例,该实例包装新创建的文件符号链接。

例外

pathpathToTargetnull

pathpathToTarget 为空。

-或-

pathpathToTarget 包含一个 null 字符。

的位置已存在一个文件或目录 path

  • 或 -

出现 I/O 错误。

适用于

另请参阅