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)

public bool IsWellFormedOriginalString ()
public boolean IsWellFormedOriginalString ()
public function IsWellFormedOriginalString () : boolean
Not applicable.

Return Value

A Boolean value that is true if the string was well-formed in accordance with RFC 2396 and RFC 2732; else false.

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



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.


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


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


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


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

The example depends on the scheme of the URI.

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. 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.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

.NET Compact Framework

Supported in: 2.0

XNA Framework

Supported in: 1.0

Community Additions