Solved

DLL Properties value?

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 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

13 Experts available now in Live!

Get 1:1 Help Now