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。

適用於