Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
This topic has not yet been rated - Rate this topic

Uri.GetLeftPart Method

Returns the specified portion of a URI.

[Visual Basic]
Public Function GetLeftPart( _
   ByVal part As UriPartial _
) As String
[C#]
public string GetLeftPart(
 UriPartial part
);
[C++]
public: String* GetLeftPart(
 UriPartial part
);
[JScript]
public function GetLeftPart(
   part : UriPartial
) : String;

Parameters

part
One of the UriPartial values that specifies the the end of the portion of the URI to return.

Return Value

A string containing the specified portion of the URI.

Remarks

The GetLeftPart method returns a string containing the left-most portion of the URI, ending with the portion specified by part. The string returned includes delimiters but does not include any fragments or queries or their delimiters, except in certain cases.

GetLeftPart includes delimiters in the following cases:

  • Scheme has the scheme delimiter added.
  • Authority does not have the path delimiter added.
  • Path includes any delimiters in the original URI up to the query or fragment delimiter.

The following examples show a URI and the results of calling GetLeftPart with Scheme, Authority, or Path.

URI Scheme Authority Path
http://www.contoso.com/index.htm#main http:// http://www.contoso.com http://www.contoso.com/index.htm
mailto:user@contoso.com?subject=uri mailto:   mailto:user@contoso.com
nntp://news.contoso.com/123456@contoso.com nntp:// nntp://news.contoso.com nntp://news.contoso.com/123456@contoso.com
news:123456@contoso.com news:   news:123456@contoso.com
file://server/filename.ext file:// file://server file://server/filename.ext
file:/filename.ext file:   file:/filename.ext

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

Uri Class | Uri Members | System Namespace

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