Manipulate URIs with Visual Studio .NET's System.URI class
Takeaway: Irina Medvinskaya explains how you use Visual Studio .NET's System.URI class to work with Uniform Resource Identifiers (URIs). This class allows you to represent and easily manipulate a given URI.
Uniform Resource Identifiers (URIs) may represent Web requests, FTP requests, files, news, and e-mail. Whenever you need to work with URIs and determine a particular portion of a given URI, you can utilize the System.URI class available in Visual Studio .NET. This class allows you to represent and easily manipulate a given URI.
To create an example, add a ListBox control to your form and call it ListBox1. Then, add the code in Listing A. The result of running this code looks like Figure 1.
In the code, I initially define a strURI variable and set its value to a link from the TechRepublic site. Then, I add the following properties of the URI object strURI to the ListBox1 control: Scheme, Host, Path, Query, Type, Port. The ListBox1 control simply displays the selected properties of the strURI object.
Miss a tip?
Check out the Visual Basic archive, and catch up on the most recent editions of Irina Medvinskaya's column.
Advance your scripting skills to the next level with TechRepublic's free Visual Basic newsletter, delivered each Friday. Automatically sign up today!
Print/View all Posts Comments on this article
SponsoredWhite Papers, Webcasts, and Downloads
- BitLocker: Is It Really Secure? Global Knowledge
- VoIP: How to Plan for the Bandwidth and Calculate the Cost Savings Global Knowledge
- Using the Six Laws of Persuasion in Negotiations Global Knowledge
Article Categories
- Security
- Security Solutions, IT Locksmith
- Networking and Communications
- E-mail Administration NetNote, Cisco Routers and Switches
- CIO and IT Management
- Project Management, CIO Issues, Strategies that Scale
- Desktops, Laptops & OS
- Windows 2000 Professional, Microsoft Word, Microsoft Excel, Microsoft Access, Windows XP,
- Data Management
- Oracle, SQL Server
- Servers
- Windows NT, Linux NetNote, Windows Server 2003
- Career Development
- Geek Trivia
- Software/Web Development
- Web Development Zone, Visual Basic, .NET






