Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleUse a FileInfo object to resolve relative path names in Visual Basic .NET
DescriptionThis example shows how to use a FileInfo object to resolve relative path names in Visual Basic .NET.
Keywordsrelative path, resolve relative path, FileInfo, VB.NET
CategoriesVB.NET, Files and Directories
 
The FileInfo object represents information about a file. The following code creates a new FileInfo object, using the relative path entered in the txtRelativePath text box in the constructor. It then displays the file's resolved name returned by the object's FullName property.
 
Dim file_info As New FileInfo(txtRelativePath.Text)
txtResolvedPath.Text = file_info.FullName
 
Note that the file and the directories in the path need not actually exist. For example, you could resolve the path "X:\apple\banana\..\fish\" even if you don't have an X drive.
 
 
Copyright © 1997-2006 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated