How get the version of the DLL ??

L

lb

Hi,

I would like to get the version of the DLL by programming in vbnet (what one
finds in the properties with the right click button).

How may i do ??

Thank you!!!
 
H

Herfried K. Wagner [MVP]

lb said:
I would like to get the version of the DLL by programming in vbnet (what
one finds in the properties with the right click button).

\\\
MsgBox( _
System.Reflection.Assembly.GetExecutingAssembly( _
).GetName().Version.ToString() _
)
///
 
G

Guest

Are you talking about the file version of the executing assembly like
Herfried answered for or getting the file version info of any file/dll?

Here's how to get the file version of any file like the properties dialog
shows:

Dim strPath As String =
Environment.GetFolderPath(Environment.SpecialFolder.System).ToString
Dim strFile As String = IO.Path.Combine(strPath, "User32.dll")

Dim fvi As System.Diagnostics.FileVersionInfo = _
System.Diagnostics.FileVersionInfo.GetVersionInfo(strFile)

MessageBox.Show(String.Format("'User32.dll' version is: {0}", _
fvi.FileVersion.ToString), "File Version Info Example")

The above gets the file version of the 'User32.DLL' file & displays it in a
message box.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top