HttpUtility.UrlEncodeUnicodeToBytes(String) Metoda

Definicja

Przestroga

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

Konwertuje ciąg Unicode na tablicę bajtów.

C#
public static byte[]? UrlEncodeUnicodeToBytes(string? str);
C#
[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);
C#
[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);
C#
public static byte[] UrlEncodeUnicodeToBytes(string str);

Parametry

str
String

Ciąg do konwersji.

Zwraca

Byte[]

Tablica bajtów.

Atrybuty

Uwagi

Jeśli znaki, takie jak puste i interpunkcyjne, są przekazywane w strumieniu HTTP, mogą być błędnie interpretowane na końcu odbierania. Kodowanie adresów URL konwertuje znaki, które nie są prawidłowe w adresie URL na odpowiedniki jednostek znaków; Dekodowanie adresów URL odwraca kodowanie. Na przykład po osadzieniu w bloku tekstu, który ma zostać przesłany w adresie URL, znaki < i > są zakodowane jako %3c i %3e.

Dotyczy

Produkt Wersje (Przestarzałe)
.NET 5, 6 (Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 7, 8, 9)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0 (4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1)
.NET Standard (2.0, 2.1)

Zobacz też