Uri.GetLeftPart Method
Assembly: System (in system.dll)
public String GetLeftPart ( UriPartial part )
public function GetLeftPart ( part : UriPartial ) : String
Not applicable.
Parameters
- part
One of the UriPartial values that specifies the end of the URI portion to return.
Return Value
A String that contains the specified portion of the Uri instance.The GetLeftPart method returns a string containing the leftmost portion of the URI string, ending with the portion specified by part.
GetLeftPart includes delimiters in the following cases:
-
Scheme includes the scheme delimiter.
-
Authority does not include the path delimiter.
-
Path includes any delimiters in the original URI up to the query or fragment delimiter.
-
Query includes the Path, plus the query and its delimiter.
The following examples show a URI and the results of calling GetLeftPart with Scheme, Authority, Path, or Query.
| URI | Scheme | Authority | Path | Query |
|---|---|---|---|---|
| http://www.contoso.com/index.htm?date=today | http:// | http://www.contoso.com | http://www.contoso.com/index.htm | http://www.contoso.com/index.htm?date=today |
| http://www.contoso.com/index.htm#main | http:// | http://www.contoso.com | http://www.contoso.com/index.htm | http://www.contoso.com/index.htm |
| mailto:user@contoso.com?subject=uri | mailto: | mailto:user@contoso.com | mailto:user@contoso.com?subject=uri | <none> |
| nntp://news.contoso.com/123456@contoso.com | nntp:// | nntp://news.contoso.com | nntp://news.contoso.com/123456@contoso.com | nntp://news.contoso.com/123456@contoso.com |
| news:123456@contoso.com | news: | news:123456@contoso.com | news:123456@contoso.com | <none> |
| file://server/filename.ext | file:// | file://server | file://server/filename.ext | file://server/filename.ext |
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.