다음을 통해 공유


Uri.FromHex 메서드

16진수의 10진수 값을 반환합니다.

네임스페이스: System
어셈블리: System(system.dll)

구문

‘선언
Public Shared Function FromHex ( _
    digit As Char _
) As Integer
‘사용 방법
Dim digit As Char
Dim returnValue As Integer

returnValue = Uri.FromHex(digit)
public static int FromHex (
    char digit
)
public:
static int FromHex (
    wchar_t digit
)
public static int FromHex (
    char digit
)
public static function FromHex (
    digit : char
) : int

매개 변수

  • digit
    변환할 16진수(0-9, a-f, A-F)입니다.

반환 값

지정된 16진수에 해당하는 0-15의 수입니다.

예외

예외 형식 조건

ArgumentException

digit가 유효한 16진수(0-9, a-f, A-F)가 아닌 경우

설명

FromHex 메서드는 16진수(0-9, a-f, A-F)를 나타내는 문자를 10진수 값(0-15)으로 변환합니다. digit가 유효한 16진수가 아니면 ArgumentException 예외가 throw됩니다.

예제

다음 예제에서는 문자가 16진 문자인지 여부를 확인하고 16진 문자이면 해당하는 10진수를 콘솔에 씁니다.

Dim testChar As Char = "e"c
If Uri.IsHexDigit(testChar) = True Then
    Console.WriteLine("'{0}' is the hexadecimal representation of {1}", testChar, Uri.FromHex(testChar))
Else
    Console.WriteLine("'{0}' is not a hexadecimal character", testChar)
End If 
Dim returnString As String = Uri.HexEscape(testChar)
Console.WriteLine("The hexadecimal value of '{0}' is {1}", testChar, returnString)
char  testChar = 'e';
if (Uri.IsHexDigit(testChar) == true)
    Console.WriteLine("'{0}' is the hexadecimal representation of {1}", testChar, Uri.FromHex(testChar));
else 
    Console.WriteLine("'{0}' is not a hexadecimal character", testChar);

string returnString = Uri.HexEscape(testChar);
Console.WriteLine("The hexadecimal value of '{0}' is {1}", testChar, returnString);

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0, 1.0에서 지원

참고 항목

참조

Uri 클래스
Uri 멤버
System 네임스페이스