On GameSpot: Snake and Sephiroth in LittleBigPlanet!

Determining file version information with VB.NET

Tags: Microsoft development tools, Programming languages, Irina Medvinskaya, FileVersionInfo, version information, Microsoft Visual Basic, Microsoft Visual Basic.Net, Visual Basic Tips Newsletter

  • Save
  • Print
  • Recommend
  • 2

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!

  • Save
  • Print
  • Recommend
  • 2

Print/View all Posts Comments on this article

Thanks wg__@... | 08/28/08

What do you think?

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

Fusion

advertisement
Click Here