Solved

DLL Properties value?

Posted on 2006-10-30
2
147 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

867 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now