Uri.UserInfo Vlastnost

Definice

Získá uživatelské jméno, heslo nebo jiné informace specifické pro uživatele přidružené k zadanému identifikátoru URI.

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

Hodnota vlastnosti

Informace o uživateli přidružené k identifikátoru URI. Vrácená hodnota neobsahuje znak @vyhrazený pro oddělení části identifikátoru URI s informacemi o uživateli.

Výjimky

Tato instance představuje relativní identifikátor URI a tato vlastnost je platná pouze pro absolutní identifikátory URI.

Příklady

Následující příklad vytvoří Uri instanci a zapíše informace o uživateli do konzoly.

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

Poznámky

Hodnota vrácená touto vlastností je obvykle ve formátu "userName:password".

Platí pro