반응형
System.Web.HttpUtility.UrlEncode / UrlDecode ASP.NET 5 대체
System.Web.HttpUtility.UrlEncode및에 대한 대체가 있는지 알고 싶습니다 UrlDecode.
내가 찾은대로 Encode: Microsoft.Framework.WebEncoders.UrlEncoder.Default.UrlEncode.
그러나 나는 찾지 못했습니다 UrlDecode. 하나있어?
System.Runtime.Extensions 는 UrlDecode및 HtmlDecode.
namespace System.Net
{
public static partial class WebUtility
{
public static string HtmlDecode(string value) { return default(string); }
public static string HtmlEncode(string value) { return default(string); }
public static string UrlDecode(string encodedValue) { return default(string); }
public static byte[] UrlDecodeToBytes(byte[] encodedValue, int offset, int count) { return default(byte[]); }
public static string UrlEncode(string value) { return default(string); }
public static byte[] UrlEncodeToBytes(byte[] value, int offset, int count) { return default(byte[]); }
}
}
최신 정보
System.Runtime.Extensions확장을 정의하는 동안 코드에서 알 수 있듯이 호출해야하는 실제 클래스는System.Net.WebUtility
옵션 1 : System.Net.WebUtility
현재 더 공개적으로 포함 할 계획이 이루어지지 Decode에를 Microsoft.Framework.WebEncoders.
용법
System.Net.WebUtility.UrlEncode(myString)
System.Net.WebUtility.UrlDecode(myString)
옵션 2 : System.Text.Encodings.Web.UrlEncoder
이것은 asp.net 핵심 서비스 컨테이너에 등록되며 컨트롤러 등에 주입 할 수 있습니다.
반응형
'Program Club' 카테고리의 다른 글
| 새 테이블 만 추가 된 경우 Room 데이터베이스 마이그레이션 (0) | 2020.11.15 |
|---|---|
| Linux OS 용 Github GUI 클라이언트가 있습니까? (0) | 2020.11.15 |
| 2016.2로 업데이트 한 후 Pycharm import RuntimeWarning (0) | 2020.11.14 |
| gradle.properties와 settings.gradle을 언제 사용합니까? (0) | 2020.11.14 |
| Haskell 기능이 정확성 속성으로 입증 / 모델 검사 / 검증 될 수 있습니까? (0) | 2020.11.14 |