Uri.GetComponents Method
Assembly: System (in system.dll)
public String GetComponents ( UriComponents components, UriFormat format )
public function GetComponents ( components : UriComponents, format : UriFormat ) : String
Parameters
- components
A bitwise combination of the UriComponents values that specifies which parts of the current instance to return to the caller.
- format
One of the UriFormat values that controls how special characters are escaped.
Return Value
A string containing the components.| Exception type | Condition |
|---|---|
| uriComponents is not a combination of valid UriComponents values. | |
| The current Uri is not an absolute URI. Relative URIs cannot be used with this method. |
When Query or Fragment is specified alone, the return value includes the delimiter. The Scheme, UserInfo, Host, Port, and Path components do not include the delimiter. For all other UriComponents values, and combinations of values, the delimiters are included in the returned value.
The components are returned in the order that they appear in the URI. For example, if Scheme is specified, it appears first.
Windows 98, Windows 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 .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Note