Uri.UserEscaped 屬性

定義

取得指出 URI 字串在 Uri 執行個體建立之前是否已完全逸出的值。

public:
 property bool UserEscaped { bool get(); };
public bool UserEscaped { get; }
member this.UserEscaped : bool
Public ReadOnly Property UserEscaped As Boolean

屬性值

Boolean

truedontEscape如果參數在建立實例時 Uri 設定 true 為 ,則為 ,否則為 false

範例

下列範例會 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

備註

屬性 UserEscaped 設定 true 為 ,表示用來建立 Uri 實例的字串在傳遞至建構函式之前已完全逸出;也就是說, dontEscape 建構函式呼叫的參數已設定為 true

適用於