共用方式為


PathUtils.NormalizePath(String) 方法

定義

將作業系統相容路徑的撰寫路徑正規化。

public static string NormalizePath (string ambiguousPath);
static member NormalizePath : string -> string
Public Shared Function NormalizePath (ambiguousPath As String) As String

參數

ambiguousPath
String

authoredPath。

傳回

以 OS 路徑表示的路徑。

備註

路徑來自撰寫的內容,不知道其執行所在的作業系統。 不論作業系統為何,這個方法都會將 / 和 \ 視為分隔符號,這表示將所有 '/' 字元變更為 '/',而 Linux/Mac '\' 則為 '/'。 這可讓作者使用 。。/foo.lg 或 ..\foo.lg 作為匯入的對等專案。

適用於