语言

Uri.UserEscaped 属性

定义

获取一个值,该值指示在创建实例之前 Uri 是否完全转义 URI 字符串。

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

属性值

如果参数设置为创建实例时,则为 />;否则为 。

示例

以下示例创建一个 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

注解

该 属性最初设计为指示用于创建 实例的字符串在传递给构造函数之前已完全转义;也就是说, 构造函数调用的参数设置为 < a0/>。 但是,由于 dontEscape 参数现已过时,因此此属性已弃用,不应使用。

适用于