Uri.UserEscaped Uri.UserEscaped Uri.UserEscaped Uri.UserEscaped Property

定义

指示 URI 字符串在创建 Uri 实例之前已被完全转义。Indicates that the URI string was completely escaped before the Uri instance was created.

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

属性值

一个 Boolean 值。如果在创建 true 实例时 dontEscape 参数设置为 true,则该值为 Uri;否则为 falseA Boolean value that is true if the dontEscape parameter was set to true when the Uri instance was created; otherwise, false.

示例

下面的示例创建一个Uri实例, 并确定它在创建后是否已完全转义。The following example creates a Uri instance and determines whether it was fully escaped when it was created.

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");
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

注解

将属性设置为true , 以指示用于创建Uri实例的字符串在传递dontEscape到构造函数之前已完全转义; 即构造函数调用的参数设置为UserEscaped true.The UserEscaped property is set to true to indicate that the string used to create the Uri instance was completely escaped before it was passed to the constructor; that is, the dontEscape parameter of the constructor call was set to true.

适用于