Uri.UserInfo 속성

정의

지정된 URI와 연결된 사용자 이름, 암호 및 기타 사용자 관련 정보를 가져옵니다.

public:
 property System::String ^ UserInfo { System::String ^ get(); };
public string UserInfo { get; }
member this.UserInfo : string
Public ReadOnly Property UserInfo As String

속성 값

URI와 연결된 사용자 정보입니다. 반환된 값에는 URI의 사용자 정보 부분을 구분하기 위해 예약된 '@' 문자가 포함되지 않습니다.

예외

이 인스턴스가 상대 URI를 나타내고 이 속성이 절대 URI에만 유효한 경우

예제

다음 예제에서는 인스턴스를 Uri 만들고 사용자 정보를 콘솔에 씁니다.

Uri^ uriAddress = gcnew Uri( "http://user:password@www.contoso.com/index.htm " );
Console::WriteLine( uriAddress->UserInfo );
Console::WriteLine( "Fully Escaped {0}",
   uriAddress->UserEscaped ? (String^)"yes" : "no" );
Uri uriAddress = new Uri ("http://user:password@www.contoso.com/index.htm ");
Console.WriteLine(uriAddress.UserInfo);
Console.WriteLine("Fully Escaped {0}", uriAddress.UserEscaped ? "yes" : "no");
let uriAddress = Uri "http://user:password@www.contoso.com/index.htm "
printfn $"{uriAddress.UserInfo}"
printfn $"""Fully Escaped {if uriAddress.UserEscaped then "yes" else "no"}"""
Dim uriAddress As New Uri("http://user:password@www.contoso.com/index.htm ")
Console.WriteLine(uriAddress.UserInfo)
Console.WriteLine("Fully Escaped {0}", IIf(uriAddress.UserEscaped, "yes", "no")) 'TODO: For performance reasons this should be changed to nested IF statements

설명

이 속성에서 반환되는 값은 일반적으로 "userName:password" 형식입니다.

적용 대상