다음을 통해 공유


방법: Visual Basic에서 URI의 구문 분석

이 예제에서는 System.Uri 클래스를 사용하여 URI를 구문 분석하는 방법을 보여 줍니다.

예제

이 예제에서는 Uri 개체의 여러 메서드를 사용하여 URI에 대한 정보를 가져옵니다.

Dim uriString As String = "https://www.contoso.com/index.htm?date=today"
Dim uriObject As New Uri(uriString)
' Display "Scheme: http"
MsgBox("Scheme: " & uriObject.Scheme)
' Display "Host: www.contoso.com"
MsgBox("Host: " & uriObject.Host)
' Display "Local path: /index.htm"
MsgBox("Local path: " & uriObject.LocalPath)
' Display "Query: ?date=today"
MsgBox("Query: " & uriObject.Query)

참고 항목

참조

Uri

기타 리소스

Visual Basic의 문자열 구문 분석