Solved

DLL Properties value?

Posted on 2006-10-30
2
148 Views
Last Modified: 2006-11-18
I am working on a vb.net project in which I need to disaply the file version of certain application components. For example I need to display to the end user what file version of the dll, ocx, and exe they currently have installed. For example if I have a dll named sample.dll, I would want to pull back something like 1.0 1011 (1.0 being the version and 1011 being the build number).

I know the directory and the files that I need to collect this data from. How can I assign a varabile the value of the file version for these?  If there an api call of some kind that I can use to get this information. The operting system is windows xp/windows 2003 server.

Can anyone help me with this?

Thanks

0
Comment
Question by:rbosco020475
2 Comments
 
LVL 7

Accepted Solution

by:
Vaxman2 earned 250 total points
ID: 17838714
Here's a console app to show how to do this:

Module Module1

      Sub Main()
            Dim sFile As String = "C:\WINDOWS\system32\gdi32.dll"
            Dim fileData As FileVersionInfo
            fileData = FileVersionInfo.GetVersionInfo(sFile)
            Console.WriteLine("Version of GDI is " & fileData.FileMajorPart & "." & fileData.FileMinorPart & "." & fileData.FileBuildPart & "." & fileData.FilePrivatePart)
            Console.WriteLine("File version is " & fileData.FileVersion)
            Console.ReadLine()
      End Sub

End Module
0
 

Author Comment

by:rbosco020475
ID: 17849637
Vaxman2 . Your sample worked out ok and was able to get the inforamtion that I need. Thanks for the help...
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question