Determining file version information with VB.NET
Takeaway: Did you know that VB.NET simplifies the process of obtaining file version information? Irina Medvinskaya shows you how to utilize the FileVersionInfo class and call its GetVersionInfo method to get this information.
In Visual Basic 6, you can get the file version information by using the API function calls. VB.NET simplifies the process by allowing you to use handy properties and methods to determine the specifics of a file version. To get this information, I'll show you how to utilize the FileVersionInfo class and call its GetVersionInfo method, which accepts the file name as a parameter.
For our example in Listing A, I will add a List Box control to the form (see Figure 1). Note: In order to run the example, you need to add this statement on the top of your form or module: Imports System.Diagnostics.FileVersionInfo.
I define the variable sFileName to hold the location of the executable for which I will get the version information. I also define the variable Info as a FileVersionInfo class and then add selected properties of the FileVersionInfo object to the list box, one by one. Figure 2 displays the result of running this example.
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!
SponsoredWhite Papers, Webcasts, and Downloads
- Improving Decision Making Through Enterprise Information Management SAP
- Live Webcast: Mobile Tools for Competitive Advantage PC Connection
- How Business Networks are Evolving Today SAP
- Case Study - Golder Associates Riverbed
- Creating Business Value Through Process Integration and Composition SAP
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
