?
Solved

DLL Properties value?

Posted on 2006-10-30
2
Medium Priority
?
157 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 1000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

830 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