Solved

DLL Properties value?

Posted on 2006-10-30
2
151 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

691 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