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

注解

UserEscaped属性设置为true以指示使用的字符串来创建Uri实例已被完全转义之前传递给构造函数; 这就是,则dontEscape构造函数调用的参数设置为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.

适用于