Uri Constructor (String)
Initializes a new instance of the Uri class with the specified URI.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Syntax
public Uri (
string uriString
)
Parameters
- uriString
A URI.
Remarks
This constructor parses the URI string, therefore it can be used to validate a URI.
Exceptions
Exception type | Condition |
---|---|
ArgumentNullException | The uriString is empty. -or- The scheme specified in uriString is not correctly formed. See IsWellFormedUriString. -or- uriString contains too many slashes. -or- The password specified in uriString is not valid. -or- The host name specified in uriString is not valid. -or- The file name specified in uriString is not valid. -or- The user name specified in uriString is not valid. -or- The host or authority name specified in uriString cannot be terminated by backslashes. -or- The port number specified in uriString is not valid or cannot be parsed. -or- The length of uriString exceeds 65534 characters. -or- The length of the scheme specified in uriString exceeds 1023 characters. -or- There is an invalid character sequence in uriString. -or- The MS-DOS path specified in uriString must start with c:\\. |
Version Information
Available in the .NET Micro Framework versions 4.0, 4.1, and 4.2.