Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get File Version of unmanaged dll

Status
Not open for further replies.

ralphtrent

Programmer
Jun 2, 2003
958
0
0
US
Hello
I need to get the file version of a dll not written in dot net. What are my options? I have tried System.Diagnostics.FileVersionInfo.GetVersionInfo(dllname).FileVersion but all i get is ??. Nothing usable.

Any help is appreciated.

Thanks
 
System.Diagnostics.FileVersionInfo.GetVersionInfo should returns what is said.
Example:
Code:
string fn="C:\\Windows\\System32\\comctl32.dll";
string fileVersion=FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo(fn);
will return fileVersion = "5.82 (xpsp.060825-0040)";
The file name can be any file, exe, dll, txt .
obislavu



 
There are low level API calls via windows that can give you that info if the wrapped .Net version doesn't provide it.

Try obislavu's suggestion first though...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top