Getting version of an exe file with out loading assembly

  • Thread starter Thread starter Brian Henry
  • Start date Start date
B

Brian Henry

If you want to read in the description/version/copyright of a file (any not
necessarly a .NET one) how would you do this? I just want to list all the
files in a directory and their version numbers if they have one thanks
 
If you want to read in the description/version/copyright of a file (any not
necessarly a .NET one) how would you do this? I just want to list all the
files in a directory and their version numbers if they have one thanks

You might want to have a look at the System.IO.FileInfo class...
 
If you want to read in the description/version/copyright of a file (any not
necessarly a .NET one) how would you do this? I just want to list all the
files in a directory and their version numbers if they have one thanks

Ooops! You wanted the file version info... You want to look at
System.Diagnostics.FileVersionInfo class :)

Imports System.Diagnostics

Dim versionInfo As FileVersionInfo = _
FileVersionInfo.GetVersionInfo ("myfile path")

Console.WriteLine (versionInfo.FileVersion)
 
I'm not seeing anything in it's members that deal with the comments, version
number, title, description or copyright of a file in the file info class...
 
thanks! that was what it needed

Tom Shelton said:
Ooops! You wanted the file version info... You want to look at
System.Diagnostics.FileVersionInfo class :)

Imports System.Diagnostics

Dim versionInfo As FileVersionInfo = _
FileVersionInfo.GetVersionInfo ("myfile path")

Console.WriteLine (versionInfo.FileVersion)
 
You might want to have a look at the System.IO.FileInfo class...


Or the FileVersionInfo class from System.Diagnostics for richer
information.
 

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

Back
Top