O'Reilly logo

Microsoft® Visual Basic® .NET Programmer's Cookbook by Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Manipulate a URI

Problem

You want to retrieve a portion of a URI (such as the prefix, directory, page, or query string arguments).

Solution

Process the URI using the System.Uri class.

Discussion

As with file path information, URIs can be written in several different forms, and represent several types of information, including Web requests (http:// and https://), FTP requests (ftp://), files (file://), news (news://), e-mail (mailto://), and so on. The Uri class provides a generic way to represent and manipulate URIs. You create a Uri instance by supplying a string that contains an absolute URI.

Dim MyUri As New Uri("http://search.yahoo.com/bin/search?p=dog")

The Uri class converts the supplied string into a standard form by taking the following steps, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required