This topic has not yet been rated - Rate this topic

Uri.IsWellFormedOriginalString Method

Indicates whether the string used to construct this Uri was well-formed and is not required to be further escaped.

Namespace:  System
Assembly:  System (in System.dll)
'Declaration
Public Function IsWellFormedOriginalString As Boolean

Return Value

Type: System.Boolean
A Boolean value that is true if the string was well-formed; else false.

The string is considered to be well-formed in accordance with RFC 2396 and RFC 2732 by default. If International Resource Identifiers (IRIs) or Internationalized Domain Name (IDN) parsing is enabled, the string is considered to be well-formed in accordance with RFC 3986 and RFC 3987

The string is considered poorly formed, causing the method to return false, if any of the following conditions occur.

Error

Example

The string is not correctly escaped.

http://www.contoso.com/path???/file name

The string is an absolute Uri that represents an implicit file Uri.

c:\\directory\filename

The string is an absolute URI that is missing a slash before the path.

file://c:/directory/filename

The string contains unescaped backslashes even if they are treated as forward slashes.

http:\\host/path/file

The string represents a hierarchical absolute Uri and does not contain "://".

www.contoso.com/path/file

The parser for the Uri.Scheme indicates that the original string was not well-formed.

The example depends on the scheme of the URI.

By default, the string used to construct this Uri are considered well-formed in accordance with RFC 2396 and RFC 2732.

When International Resource Identifier (IRI) and Internationalized Domain Name (IDN) support are enabled, the string used to construct this Uri are considered well-formed in accordance with RFC 3986 and RFC 3987. Punycode names used to support IRI contain only ASCII characters and always start with the xn-- prefix.

For more information on IRI support, see the Remarks section for the Uri class.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

.NET for Windows Store apps

Supported in: Windows 8

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone 8, Silverlight 8.1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.