Uri.UserEscaped Property

Definition

表示 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

Property Value

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.

Examples

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

Remarks

[UserEscaped] 屬性會設定為 [true],表示用來建立 Uri 實例的字串在傳遞至函式之前已完全被轉義;也就是,已將此函式呼叫的 dontEscape 參數設定為 trueThe 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.

Applies to