Exe or DLL version

G

Guest

How do i get the exe version of a .exe or a .dll program, currently I'm doing
it like this:

System::Reflection::Assembly^ _asmb =
System::Reflection::Assembly::LoadFrom(mFileName);
String^ mName = _asmb->get_FullName();
Char delimiter[] = L","->ToCharArray();
String^ mParts[] = mName->Split(delimiter);
String^ mVersion = mParts->get_Item(1)->ToString();

but the problem is that i cannot move this .exe file during this process, i
can move it when this process stops but i need to copy it during the process.

does anybody knows how to unload it or how to get the program version?
 
M

Mattias Sjögren

does anybody knows how to unload it or how to get the program version?

Use FileVersionInfo::GetVersionInfo() if you want the file version, or
AssemblyName::GetAssemblyName() if you wnat the assembly version.


Mattias
 
G

Guest

thank you very much!!

this FileVersionInfo::GetVersionInfo() thing worked pretty good for me
 

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