Uri.UserInfo プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
指定した 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 = 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" の形式です。