語言

Uri.UserEscaped 屬性

定義

會取得一個值,表示 URI 字串在建立實例前 Uri 是否已被完全轉義。

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

屬性值

true 若 dontEscape 參數設定為 true 實例建立時 Uri ;否則, false。

範例

以下範例建立一個 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

備註

此 UserEscaped 屬性最初設計用以表示用於建立實 Uri 例的字串在傳遞給建構子之前已被完全轉義;也就是說, dontEscape 建構者呼叫的參數被設定為 true。 然而,由於該 dontEscape 參數已過時,此特性已被棄用,不應再使用。

適用於