다음을 통해 공유


Uri.CheckSchemeName 메서드

지정된 체계 이름이 유효한지 여부를 확인합니다.

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

구문

‘선언
Public Shared Function CheckSchemeName ( _
    schemeName As String _
) As Boolean
‘사용 방법
Dim schemeName As String
Dim returnValue As Boolean

returnValue = Uri.CheckSchemeName(schemeName)
public static bool CheckSchemeName (
    string schemeName
)
public:
static bool CheckSchemeName (
    String^ schemeName
)
public static boolean CheckSchemeName (
    String schemeName
)
public static function CheckSchemeName (
    schemeName : String
) : boolean

매개 변수

  • schemeName
    유효성을 확인할 체계 이름입니다.

반환 값

체계 이름이 유효하면 true이고 그렇지 않으면 false입니다.

설명

이 메서드는 RFC 2396에 따라 체계 이름의 유효성을 확인합니다. 체계 이름은 문자로 시작해야 하며 문자, 숫자 및 ".", "+", "-" 문자만 포함해야 합니다.

예제

다음 예제에서는 Uri 인스턴스를 만들고 체계 이름이 유효한지 여부를 확인합니다.

Dim address1 As New Uri("https://www.contoso.com/index.htm#search")
Console.WriteLine("address 1 {0} a valid scheme name", IIf(Uri.CheckSchemeName(address1.Scheme), " has", " does not have")) 'TODO: For performance reasons this should be changed to nested IF statements

If address1.Scheme = Uri.UriSchemeHttp Then
    Console.WriteLine("Uri is HTTP type")
End If 
Console.WriteLine(address1.HostNameType)
Uri address1 = new Uri("https://www.contoso.com/index.htm#search");
Console.WriteLine("address 1 {0} a valid scheme name",
      Uri.CheckSchemeName(address1.Scheme) ? " has" : " does not have");

if (address1.Scheme == Uri.UriSchemeHttp)
    Console.WriteLine("Uri is HTTP type");
      
Console.WriteLine(address1.HostNameType);

플랫폼

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 네임스페이스