共用方式為


HttpUtility.UrlEncodeUnicodeToBytes(String) 方法

定義

警告

This method produces non-standards-compliant output and has interoperability issues. The preferred alternative is UrlEncodeToBytes(String).

將 Unicode 字串轉換成位元組陣列。

public:
 static cli::array <System::Byte> ^ UrlEncodeUnicodeToBytes(System::String ^ str);
public static byte[]? UrlEncodeUnicodeToBytes (string? str);
[System.Obsolete("This method produces non-standards-compliant output and has interoperability issues. The preferred alternative is UrlEncodeToBytes(String).")]
public static byte[]? UrlEncodeUnicodeToBytes (string? str);
[System.Obsolete("This method produces non-standards-compliant output and has interoperability issues. The preferred alternative is UrlEncodeToBytes(String).")]
public static byte[] UrlEncodeUnicodeToBytes (string str);
public static byte[] UrlEncodeUnicodeToBytes (string str);
static member UrlEncodeUnicodeToBytes : string -> byte[]
[<System.Obsolete("This method produces non-standards-compliant output and has interoperability issues. The preferred alternative is UrlEncodeToBytes(String).")>]
static member UrlEncodeUnicodeToBytes : string -> byte[]
Public Shared Function UrlEncodeUnicodeToBytes (str As String) As Byte()

參數

str
String

要轉換的字串。

傳回

Byte[]

位元組陣列。

屬性

備註

如果在 HTTP 數據流中傳遞空白和標點符號之類的字元,在接收端可能會被誤譯。 URL 編碼會將 URL 中無效的字元轉換為字元實體對等專案;URL 譯碼會反轉編碼。 例如,當內嵌在 URL 中傳輸的文字區塊時,和 > 會<編碼為 %3c 和 %3e。

適用於

另請參閱