共用方式為


HttpEncoder.UrlPathEncode(String) 方法

定義

編碼 URL 的子區段。

protected public:
 virtual System::String ^ UrlPathEncode(System::String ^ value);
protected internal virtual string UrlPathEncode (string value);
abstract member UrlPathEncode : string -> string
override this.UrlPathEncode : string -> string
Protected Friend Overridable Function UrlPathEncode (value As String) As String

參數

value
String

要編碼的字串。

傳回

URL 編碼的字串。

備註

UrlPathEncode 方法會呼叫 UrlPathEncode 方法。 方法 UrlPathEncode 會執行下列步驟:

  • 將 方法的 UrlPathEncode 編碼邏輯只套用至 URL 的路徑部分, (其中排除查詢字串) 。 方法假設 URL 編碼為 UTF-8 字串。

  • 編碼非空格,讓產生的編碼字串中只會使用前 128 個 ASCII 字元的子集。 Unicode 值 128 和更新版本或 32 和更少的任何字元都是 URL 編碼。

  • 將空格編碼為 %20。

適用於