System


.NET Framework Class Library
UriComponents Enumeration

Note: This enumeration is new in the .NET Framework version 2.0.

Specifies the parts of a Uri.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

Namespace: System
Assembly: System (in system.dll)

Syntax

Visual Basic (Declaration)
<FlagsAttribute> _
Public Enumeration UriComponents
Visual Basic (Usage)
Dim instance As UriComponents
C#
[FlagsAttribute] 
public enum UriComponents
C++
[FlagsAttribute] 
public enum class UriComponents
J#
/** @attribute FlagsAttribute() */ 
public enum UriComponents
JScript
FlagsAttribute 
public enum UriComponents
Members

 Member nameDescription
Supported by the .NET Compact FrameworkAbsoluteUriThe Scheme, UserInfo, Host, Port, LocalPath, Query, and Fragment data. 
Supported by the .NET Compact FrameworkFragmentThe Fragment data. 
Supported by the .NET Compact FrameworkHostThe Host data. 
Supported by the .NET Compact FrameworkHostAndPortThe Host and Port data. If no port data is in the Uri and a default port has been assigned to the Scheme, the default port is returned. If there is no default port, -1 is returned. 
Supported by the .NET Compact FrameworkHttpRequestUrlThe Scheme, Host, Port, LocalPath, and Query data. 
Supported by the .NET Compact FrameworkKeepDelimiterSpecifies that the delimiter should be included. 
Supported by the .NET Compact FrameworkPathThe LocalPath data. 
Supported by the .NET Compact FrameworkPathAndQueryThe LocalPath and Query data. Also see PathAndQuery.  
Supported by the .NET Compact FrameworkPortThe Port data. 
Supported by the .NET Compact FrameworkQueryThe Query data. 
Supported by the .NET Compact FrameworkSchemeThe Scheme data. 
Supported by the .NET Compact FrameworkSchemeAndServerThe Scheme, Host, and Port data. 
Supported by the .NET Compact FrameworkSerializationInfoStringThe complete Uri context that is needed for Uri Serializers. The context includes the IPv6 scope. 
Supported by the .NET Compact FrameworkStrongAuthorityThe UserInfo, Host, and Port data. If no port data is in the Uri and a default port has been assigned to the Scheme, the default port is returned. If there is no default port, -1 is returned. 
Supported by the .NET Compact FrameworkStrongPortThe Port data. If no port data is in the Uri and a default port has been assigned to the Scheme, the default port is returned. If there is no default port, -1 is returned. 
Supported by the .NET Compact FrameworkUserInfoThe UserInfo data. 
Remarks

This enumeration is used to identify the parts of a Uri. This enumeration is used with the >System.UriScheme.GetComponents(System.Uri,System.UriComponents,System.UriFormat method.

Platforms

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.

Version Information

.NET Framework

Supported in: 2.0

.NET Compact Framework

Supported in: 2.0
See Also

Tags :


Community Content

Dave Sexton
Example

Given the following Uri:

    
       http://user:password@msdn.microsoft.com:8080/path/filename.ext?name=value#bookmark
    
  

these are the unescaped values returned by the Uri.GetComponents method in the .NET 2.0 Framework:

  UriComponents 	Without KeepDelimiter 			With KeepDelimiter
      
  Fragment 	bookmark					#bookmark
Host msdn.microsoft.com msdn.microsoft.com
HostAndPort msdn.microsoft.com:8080 msdn.microsoft.com:8080
Path path/filename.ext /path/filename.ext
PathAndQuery /path/filename.ext?name=value /path/filename.ext?name=value
Port 8080 :8080
Query name=value ?name=value
Scheme http http://
SchemeAndServer http://msdn.microsoft.com:8080 http://msdn.microsoft.com:8080
StrongAuthority user:password@msdn.microsoft.com:8080 user:password@msdn.microsoft.com:8080
StrongPort 8080 :8080
UserInfo user:password user:password@
Tags :

Page view tracker